diff --git a/configure.ac b/configure.ac index 645a29aac..82856d0fd 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([cyassl],[2.2.4],[http://www.yassl.com]) +AC_INIT([cyassl],[2.2.5],[http://www.yassl.com]) AC_CONFIG_AUX_DIR(config) @@ -289,6 +289,20 @@ fi AM_CONDITIONAL([BUILD_SNIFFER], [test "x$ENABLED_SNIFFER" = "xyes"]) +# AES-GCM +AC_ARG_ENABLE(aesgcm, + [ --enable-aesgcm Enable CyaSSL AES-GCM support (default: disabled)], + [ ENABLED_AESGCM=$enableval ], + [ ENABLED_AESGCM=no ] + ) + +if test "$ENABLED_AESGCM" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM" +fi + +AM_CONDITIONAL([BUILD_AESGCM], [test "x$ENABLED_AESGCM" = "xyes"]) + # AES-NI AC_ARG_ENABLE(aesni, [ --enable-aesni Enable CyaSSL AES-NI support (default: disabled)], diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index ca1afb140..b003c7747 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -1404,5 +1404,31 @@ void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) #endif /* CYASSL_AES_COUNTER */ + +#ifdef HAVE_AESGCM + +void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, + byte* authTag, word32 authTagSz, + const byte* authIn, word32 authInSz) +{ + word32 blocks = sz / AES_BLOCK_SIZE; + + CYASSL_ENTER("AesGcmEncrypt"); + while (blocks--) { + } +} + + +int AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, + const byte* authTag, word32 authTagSz, + const byte* authIn, word32 authInSz) +{ + CYASSL_ENTER("AesGcmDecrypt"); + return 0; +} + +#endif /* HAVE_AESGCM */ + + #endif /* NO_AES */ diff --git a/cyassl/ctaocrypt/aes.h b/cyassl/ctaocrypt/aes.h index c3356de4a..73e84b499 100644 --- a/cyassl/ctaocrypt/aes.h +++ b/cyassl/ctaocrypt/aes.h @@ -80,6 +80,15 @@ CYASSL_API void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz); CYASSL_API void AesEncryptDirect(Aes* aes, byte* out, const byte* in); CYASSL_API void AesDecryptDirect(Aes* aes, byte* out, const byte* in); +#ifdef HAVE_AESGCM +CYASSL_API void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz, + byte* authTag, word32 authTagSz, + const byte* authIn, word32 authInSz); +CYASSL_API int AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz, + const byte* authTag, word32 authTagSz, + const byte* authIn, word32 authInSz); +#endif /* HAVE_AESGCM */ + #ifdef __cplusplus } /* extern "C" */