{"SHA384", HASH_OID_SHA384, GNUTLS_MAC_SHA384, 48, 48, 0, 0, 1},
{"SHA512", HASH_OID_SHA512, GNUTLS_MAC_SHA512, 64, 64, 0, 0, 1},
{"SHA224", HASH_OID_SHA224, GNUTLS_MAC_SHA224, 28, 28, 0, 0, 1},
-#ifdef HAVE_NETTLE27
{"UMAC-96", NULL, GNUTLS_MAC_UMAC_96, 12, 16, 8, 0, 1},
-#endif
{"AEAD", NULL, GNUTLS_MAC_AEAD, 0, 0, 0, 1, 1},
{"MD2", HASH_OID_MD2, GNUTLS_MAC_MD2, 0, 0, 0, 0, 0}, /* not used as MAC */
{"RIPEMD160", HASH_OID_RMD160, GNUTLS_MAC_RMD160, 20, 20, 0, 0, 1},
case GNUTLS_CIPHER_DES_CBC:
case GNUTLS_CIPHER_ARCFOUR_128:
case GNUTLS_CIPHER_SALSA20_256:
-#ifdef HAVE_NETTLE27
case GNUTLS_CIPHER_ESTREAM_SALSA20_256:
-#endif
case GNUTLS_CIPHER_ARCFOUR_40:
case GNUTLS_CIPHER_RC2_40_CBC:
return 1;
ctx->ctx_ptr = &ctx->ctx.salsa20;
ctx->block_size = 1;
break;
-#ifdef HAVE_NETTLE27
case GNUTLS_CIPHER_ESTREAM_SALSA20_256:
ctx->encrypt = stream_encrypt;
ctx->decrypt = stream_encrypt;
ctx->ctx_ptr = &ctx->ctx.salsa20;
ctx->block_size = 1;
break;
-#endif
case GNUTLS_CIPHER_RC2_40_CBC:
ctx->encrypt = cbc_encrypt;
ctx->decrypt = cbc_decrypt;
#include <nettle/md2.h>
#include <nettle/sha.h>
#include <nettle/hmac.h>
-#ifdef HAVE_NETTLE27
-# include <nettle/umac.h>
-#endif
+#include <nettle/umac.h>
typedef void (*update_func) (void *, unsigned, const uint8_t *);
typedef void (*digest_func) (void *, unsigned, uint8_t *);
struct hmac_sha384_ctx sha384;
struct hmac_sha512_ctx sha512;
struct hmac_sha1_ctx sha1;
-#ifdef HAVE_NETTLE27
struct umac96_ctx umac;
-#endif
} ctx;
/* this is the context just after
struct hmac_sha384_ctx sha384;
struct hmac_sha512_ctx sha512;
struct hmac_sha1_ctx sha1;
-#ifdef HAVE_NETTLE27
struct umac96_ctx umac;
-#endif
} init_ctx;
void *ctx_ptr;
gnutls_mac_algorithm_t algo;
set_nonce_func set_nonce;
};
-#ifdef HAVE_NETTLE27
static void
_wrap_umac96_set_key(void* ctx, unsigned len, const uint8_t* key)
{
return umac96_set_key(ctx, key);
}
-#endif
static int _mac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_mac_ctx *ctx)
{
ctx->ctx_ptr = &ctx->ctx.sha512;
ctx->length = SHA512_DIGEST_SIZE;
break;
-#ifdef HAVE_NETTLE27
case GNUTLS_MAC_UMAC_96:
ctx->update = (update_func) umac96_update;
ctx->digest = (digest_func) umac96_digest;
ctx->ctx_ptr = &ctx->ctx.umac;
ctx->length = 12;
break;
-#endif
default:
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
case GNUTLS_MAC_SHA256:
case GNUTLS_MAC_SHA384:
case GNUTLS_MAC_SHA512:
-#ifdef HAVE_NETTLE27
case GNUTLS_MAC_UMAC_96:
-#endif
return 1;
default:
return 0;
AC_MSG_CHECKING([whether to use nettle])
if test "$cryptolib" = "nettle";then
AC_MSG_RESULT(yes)
- AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/rsa.h>],
- [rsa_decrypt_tr (0,0,0,0,0,0,0)])
+ AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/umac.h>],
+ [nettle_umac96_set_nonce (0,0,0)])
if test "$ac_cv_libnettle" != yes; then
AC_MSG_ERROR([[
***
- *** Libnettle 2.5 was not found. Note that you must compile nettle with gmp support.
+ *** Libnettle 2.7 was not found. Note that you must compile nettle with gmp support.
]])
fi
else
fi
AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
- AC_CHECK_LIB([nettle], [nettle_umac96_set_nonce], [AC_DEFINE([HAVE_NETTLE27], [], [UMAC detected in nettle])])
-
AC_ARG_WITH(included-libtasn1,
AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
included_libtasn1=$withval,