rijndael.c: Do not include functions already present for ESP-IDF
ESP-IDF platform already has rijndaelEncrypt() defined causing link
errors. This change excludes rijndaelEncrypt() and rijndaelKeySetupEnc()
functions if building for the ESP-IDF platform.
Change-Id: I54595784e74848a47a2546d88a1c74506015fa58
Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
diff --git a/aes/rijndael.c b/aes/rijndael.c
index c7eaabd..9b19c70 100644
--- a/aes/rijndael.c
+++ b/aes/rijndael.c
@@ -722,6 +722,7 @@
#define GETU32(pt) (((aes_u32)(pt)[0] << 24) ^ ((aes_u32)(pt)[1] << 16) ^ ((aes_u32)(pt)[2] << 8) ^ ((aes_u32)(pt)[3]))
#define PUTU32(ct, st) { (ct)[0] = (aes_u8)((st) >> 24); (ct)[1] = (aes_u8)((st) >> 16); (ct)[2] = (aes_u8)((st) >> 8); (ct)[3] = (aes_u8)(st); }
+#ifndef ESPIDF_VERSION
/**
* Expand the cipher key into the encryption key schedule.
*
@@ -808,6 +809,7 @@
}
return 0;
}
+#endif /* ! ESPIDF_VERSION */
#ifdef WITH_AES_DECRYPT
/**
@@ -859,6 +861,7 @@
}
#endif
+#ifndef ESPIDF_VERSION
void
rijndaelEncrypt(const aes_u32 rk[/*4*(Nr + 1)*/], int Nr, const aes_u8 pt[16],
aes_u8 ct[16])
@@ -1042,6 +1045,7 @@
rk[3];
PUTU32(ct + 12, s3);
}
+#endif /* ! ESPIDF_VERSION */
#ifdef WITH_AES_DECRYPT
static void