#include <nettle/version.h>
#define ARCHIVE_CRYPTOR_USE_NETTLE 1
+#ifndef AES_MAX_KEY_SIZE
+#define AES_MAX_KEY_SIZE AES256_KEY_SIZE
+#endif
+
typedef struct {
#if NETTLE_VERSION_MAJOR < 3
struct aes_ctx ctx;
}
#elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_HMAC_H)
+#include <nettle/version.h>
static int
__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
static void
__hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len)
{
+#if NETTLE_VERSION_MAJOR < 4
hmac_sha1_digest(ctx, (unsigned)*out_len, out);
+#else
+ hmac_sha1_digest(ctx, out);
+ *out_len = SHA1_DIGEST_SIZE;
+#endif
}
static void