Commit e6782e05 authored by Niels Möller's avatar Niels Möller

Moved all typedefs for function types to nettle-types.h. Use

non-pointer types, so that the types can be used to declare functions.
Updated all users.

Rev: nettle/arcfour-meta.c:1.2
Rev: nettle/cbc.h:1.2
Rev: nettle/des-compat.c:1.2
Rev: nettle/examples/nettle-benchmark.c:1.3
Rev: nettle/examples/nettle-openssl.c:1.2
Rev: nettle/examples/rsa-encrypt.c:1.2
Rev: nettle/examples/rsa-keygen.c:1.2
Rev: nettle/nettle-internal.c:1.2
Rev: nettle/nettle-meta.h:1.2
Rev: nettle/nettle-types.h:1.2
Rev: nettle/testsuite/dsa-keygen-test.c:1.3
Rev: nettle/testsuite/rsa-encrypt-test.c:1.3
Rev: nettle/testsuite/rsa-keygen-test.c:1.3
Rev: nettle/testsuite/testutils.c:1.3
parent d2ea4c93
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
const struct nettle_cipher nettle_arcfour128 = const struct nettle_cipher nettle_arcfour128 =
{ "arcfour128", sizeof(struct arcfour_ctx), { "arcfour128", sizeof(struct arcfour_ctx),
0, 16, 0, 16,
(nettle_set_key_func) arcfour_set_key, (nettle_set_key_func *) arcfour_set_key,
(nettle_set_key_func) arcfour_set_key, (nettle_set_key_func *) arcfour_set_key,
(nettle_crypt_func) arcfour_crypt, (nettle_crypt_func *) arcfour_crypt,
(nettle_crypt_func) arcfour_crypt (nettle_crypt_func *) arcfour_crypt
}; };
...@@ -57,14 +57,14 @@ memcpy((ctx)->iv, (data), sizeof((ctx)->iv)) ...@@ -57,14 +57,14 @@ memcpy((ctx)->iv, (data), sizeof((ctx)->iv))
#define CBC_ENCRYPT(self, f, length, dst, src) \ #define CBC_ENCRYPT(self, f, length, dst, src) \
(0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \ (0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \
: cbc_encrypt((void *) &(self)->ctx, \ : cbc_encrypt((void *) &(self)->ctx, \
(nettle_crypt_func) (f), \ (nettle_crypt_func *) (f), \
sizeof((self)->iv), (self)->iv, \ sizeof((self)->iv), (self)->iv, \
(length), (dst), (src))) (length), (dst), (src)))
#define CBC_DECRYPT(self, f, length, dst, src) \ #define CBC_DECRYPT(self, f, length, dst, src) \
(0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \ (0 ? ((f)(&(self)->ctx, 0, NULL, NULL)) \
: cbc_decrypt((void *) &(self)->ctx, \ : cbc_decrypt((void *) &(self)->ctx, \
(nettle_crypt_func) (f), \ (nettle_crypt_func *) (f), \
sizeof((self)->iv), (self)->iv, \ sizeof((self)->iv), (self)->iv, \
(length), (dst), (src))) (length), (dst), (src)))
......
...@@ -113,13 +113,13 @@ des_ncbc_encrypt(const_des_cblock *src, des_cblock *dst, long length, ...@@ -113,13 +113,13 @@ des_ncbc_encrypt(const_des_cblock *src, des_cblock *dst, long length,
switch (enc) switch (enc)
{ {
case DES_ENCRYPT: case DES_ENCRYPT:
nettle_cbc_encrypt(ctx, (nettle_crypt_func) des_encrypt, nettle_cbc_encrypt(ctx, (nettle_crypt_func *) des_encrypt,
DES_BLOCK_SIZE, *iv, DES_BLOCK_SIZE, *iv,
length, *dst, *src); length, *dst, *src);
break; break;
case DES_DECRYPT: case DES_DECRYPT:
nettle_cbc_decrypt(ctx, nettle_cbc_decrypt(ctx,
(nettle_crypt_func) des_decrypt, (nettle_crypt_func *) des_decrypt,
DES_BLOCK_SIZE, *iv, DES_BLOCK_SIZE, *iv,
length, *dst, *src); length, *dst, *src);
break; break;
...@@ -166,12 +166,12 @@ des_ede3_cbc_encrypt(const_des_cblock *src, des_cblock *dst, long length, ...@@ -166,12 +166,12 @@ des_ede3_cbc_encrypt(const_des_cblock *src, des_cblock *dst, long length,
switch (enc) switch (enc)
{ {
case DES_ENCRYPT: case DES_ENCRYPT:
nettle_cbc_encrypt(&keys, (nettle_crypt_func) des_compat_des3_encrypt, nettle_cbc_encrypt(&keys, (nettle_crypt_func *) des_compat_des3_encrypt,
DES_BLOCK_SIZE, *iv, DES_BLOCK_SIZE, *iv,
length, *dst, *src); length, *dst, *src);
break; break;
case DES_DECRYPT: case DES_DECRYPT:
nettle_cbc_decrypt(&keys, (nettle_crypt_func) des_compat_des3_decrypt, nettle_cbc_decrypt(&keys, (nettle_crypt_func *) des_compat_des3_decrypt,
DES_BLOCK_SIZE, *iv, DES_BLOCK_SIZE, *iv,
length, *dst, *src); length, *dst, *src);
break; break;
......
...@@ -86,7 +86,7 @@ time_function(void (*f)(void *arg), void *arg) ...@@ -86,7 +86,7 @@ time_function(void (*f)(void *arg), void *arg)
struct bench_hash_info struct bench_hash_info
{ {
void *ctx; void *ctx;
nettle_hash_update_func update; nettle_hash_update_func *update;
const uint8_t *data; const uint8_t *data;
}; };
...@@ -100,7 +100,7 @@ bench_hash(void *arg) ...@@ -100,7 +100,7 @@ bench_hash(void *arg)
struct bench_cipher_info struct bench_cipher_info
{ {
void *ctx; void *ctx;
nettle_crypt_func crypt; nettle_crypt_func *crypt;
uint8_t *data; uint8_t *data;
}; };
...@@ -114,7 +114,7 @@ bench_cipher(void *arg) ...@@ -114,7 +114,7 @@ bench_cipher(void *arg)
struct bench_cbc_info struct bench_cbc_info
{ {
void *ctx; void *ctx;
nettle_crypt_func crypt; nettle_crypt_func *crypt;
uint8_t *data; uint8_t *data;
......
...@@ -50,20 +50,21 @@ ...@@ -50,20 +50,21 @@
/* AES */ /* AES */
static nettle_set_key_func openssl_aes_set_encrypt_key;
static void static void
openssl_aes_set_encrypt_key(void *ctx, unsigned length, const uint8_t *key) openssl_aes_set_encrypt_key(void *ctx, unsigned length, const uint8_t *key)
{ {
AES_set_encrypt_key(key, length * 8, ctx); AES_set_encrypt_key(key, length * 8, ctx);
} }
static nettle_set_key_func openssl_aes_set_decrypt_key;
static void static void
openssl_aes_set_decrypt_key(void *ctx, unsigned length, const uint8_t *key) openssl_aes_set_decrypt_key(void *ctx, unsigned length, const uint8_t *key)
{ {
AES_set_decrypt_key(key, length * 8, ctx); AES_set_decrypt_key(key, length * 8, ctx);
} }
static nettle_crypt_func openssl_aes_encrypt;
static void static void
openssl_aes_encrypt(void *ctx, unsigned length, openssl_aes_encrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -78,6 +79,7 @@ openssl_aes_encrypt(void *ctx, unsigned length, ...@@ -78,6 +79,7 @@ openssl_aes_encrypt(void *ctx, unsigned length,
} }
} }
static nettle_crypt_func openssl_aes_decrypt;
static void static void
openssl_aes_decrypt(void *ctx, unsigned length, openssl_aes_decrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -123,14 +125,14 @@ nettle_openssl_aes256 = { ...@@ -123,14 +125,14 @@ nettle_openssl_aes256 = {
}; };
/* Arcfour */ /* Arcfour */
static nettle_set_key_func openssl_arcfour_set_key;
static void static void
openssl_arcfour_set_key(void *ctx, unsigned length, const uint8_t *key) openssl_arcfour_set_key(void *ctx, unsigned length, const uint8_t *key)
{ {
RC4_set_key(ctx, length, key); RC4_set_key(ctx, length, key);
} }
static nettle_crypt_func openssl_arcfour_crypt;
static void static void
openssl_arcfour_crypt(void *ctx, unsigned length, openssl_arcfour_crypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -147,13 +149,14 @@ nettle_openssl_arcfour128 = { ...@@ -147,13 +149,14 @@ nettle_openssl_arcfour128 = {
}; };
/* Blowfish */ /* Blowfish */
static nettle_set_key_func openssl_bf_set_key;
static void static void
openssl_bf_set_key(void *ctx, unsigned length, const uint8_t *key) openssl_bf_set_key(void *ctx, unsigned length, const uint8_t *key)
{ {
BF_set_key(ctx, length, key); BF_set_key(ctx, length, key);
} }
static nettle_crypt_func openssl_bf_encrypt;
static void static void
openssl_bf_encrypt(void *ctx, unsigned length, openssl_bf_encrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -168,6 +171,7 @@ openssl_bf_encrypt(void *ctx, unsigned length, ...@@ -168,6 +171,7 @@ openssl_bf_encrypt(void *ctx, unsigned length,
} }
} }
static nettle_crypt_func openssl_bf_decrypt;
static void static void
openssl_bf_decrypt(void *ctx, unsigned length, openssl_bf_decrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -192,6 +196,7 @@ nettle_openssl_blowfish128 = { ...@@ -192,6 +196,7 @@ nettle_openssl_blowfish128 = {
/* DES */ /* DES */
static nettle_set_key_func openssl_des_set_key;
static void static void
openssl_des_set_key(void *ctx, unsigned length, const uint8_t *key) openssl_des_set_key(void *ctx, unsigned length, const uint8_t *key)
{ {
...@@ -205,6 +210,7 @@ openssl_des_set_key(void *ctx, unsigned length, const uint8_t *key) ...@@ -205,6 +210,7 @@ openssl_des_set_key(void *ctx, unsigned length, const uint8_t *key)
#define DES_BLOCK_SIZE 8 #define DES_BLOCK_SIZE 8
static nettle_crypt_func openssl_des_encrypt;
static void static void
openssl_des_encrypt(void *ctx, unsigned length, openssl_des_encrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -219,6 +225,7 @@ openssl_des_encrypt(void *ctx, unsigned length, ...@@ -219,6 +225,7 @@ openssl_des_encrypt(void *ctx, unsigned length,
} }
} }
static nettle_crypt_func openssl_des_decrypt;
static void static void
openssl_des_decrypt(void *ctx, unsigned length, openssl_des_decrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -243,12 +250,14 @@ nettle_openssl_des = { ...@@ -243,12 +250,14 @@ nettle_openssl_des = {
/* Cast128 */ /* Cast128 */
static nettle_set_key_func openssl_cast_set_key;
static void static void
openssl_cast_set_key(void *ctx, unsigned length, const uint8_t *key) openssl_cast_set_key(void *ctx, unsigned length, const uint8_t *key)
{ {
CAST_set_key(ctx, length, key); CAST_set_key(ctx, length, key);
} }
static nettle_crypt_func openssl_cast_encrypt;
static void static void
openssl_cast_encrypt(void *ctx, unsigned length, openssl_cast_encrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -263,6 +272,7 @@ openssl_cast_encrypt(void *ctx, unsigned length, ...@@ -263,6 +272,7 @@ openssl_cast_encrypt(void *ctx, unsigned length,
} }
} }
static nettle_crypt_func openssl_cast_decrypt;
static void static void
openssl_cast_decrypt(void *ctx, unsigned length, openssl_cast_decrypt(void *ctx, unsigned length,
uint8_t *dst, const uint8_t *src) uint8_t *dst, const uint8_t *src)
...@@ -288,13 +298,14 @@ nettle_openssl_cast128 = { ...@@ -288,13 +298,14 @@ nettle_openssl_cast128 = {
/* Hash functions */ /* Hash functions */
/* md5 */ /* md5 */
static nettle_hash_init_func openssl_md5_init;
static void static void
openssl_md5_init(void *ctx) openssl_md5_init(void *ctx)
{ {
MD5_Init(ctx); MD5_Init(ctx);
} }
static nettle_hash_update_func openssl_md5_update;
static void static void
openssl_md5_update(void *ctx, openssl_md5_update(void *ctx,
unsigned length, unsigned length,
...@@ -303,6 +314,7 @@ openssl_md5_update(void *ctx, ...@@ -303,6 +314,7 @@ openssl_md5_update(void *ctx,
MD5_Update(ctx, src, length); MD5_Update(ctx, src, length);
} }
static nettle_hash_digest_func openssl_md5_digest;
static void static void
openssl_md5_digest(void *ctx, openssl_md5_digest(void *ctx,
unsigned length, uint8_t *dst) unsigned length, uint8_t *dst)
...@@ -322,13 +334,14 @@ nettle_openssl_md5 = { ...@@ -322,13 +334,14 @@ nettle_openssl_md5 = {
}; };
/* sha1 */ /* sha1 */
static nettle_hash_init_func openssl_sha1_init;
static void static void
openssl_sha1_init(void *ctx) openssl_sha1_init(void *ctx)
{ {
SHA1_Init(ctx); SHA1_Init(ctx);
} }
static nettle_hash_update_func openssl_sha1_update;
static void static void
openssl_sha1_update(void *ctx, openssl_sha1_update(void *ctx,
unsigned length, unsigned length,
...@@ -337,6 +350,7 @@ openssl_sha1_update(void *ctx, ...@@ -337,6 +350,7 @@ openssl_sha1_update(void *ctx,
SHA1_Update(ctx, src, length); SHA1_Update(ctx, src, length);
} }
static nettle_hash_digest_func openssl_sha1_digest;
static void static void
openssl_sha1_digest(void *ctx, openssl_sha1_digest(void *ctx,
unsigned length, uint8_t *dst) unsigned length, uint8_t *dst)
......
...@@ -220,7 +220,7 @@ main(int argc, char **argv) ...@@ -220,7 +220,7 @@ main(int argc, char **argv)
mpz_init(x); mpz_init(x);
if (!rsa_encrypt(&key, if (!rsa_encrypt(&key,
&ctx.yarrow, (nettle_random_func) yarrow256_random, &ctx.yarrow, (nettle_random_func *) yarrow256_random,
sizeof(info.key), info.key, sizeof(info.key), info.key,
x)) x))
{ {
......
...@@ -113,7 +113,7 @@ main(int argc, char **argv) ...@@ -113,7 +113,7 @@ main(int argc, char **argv)
if (!rsa_generate_keypair if (!rsa_generate_keypair
(&pub, &priv, (&pub, &priv,
(void *) &yarrow, (nettle_random_func) yarrow256_random, (void *) &yarrow, (nettle_random_func *) yarrow256_random,
NULL, progress, NULL, progress,
KEYSIZE, ESIZE)) KEYSIZE, ESIZE))
{ {
......
...@@ -66,8 +66,8 @@ nettle_des = { ...@@ -66,8 +66,8 @@ nettle_des = {
"des", sizeof(struct des_ctx), "des", sizeof(struct des_ctx),
DES_BLOCK_SIZE, DES_KEY_SIZE, DES_BLOCK_SIZE, DES_KEY_SIZE,
des_set_key_hack, des_set_key_hack, des_set_key_hack, des_set_key_hack,
(nettle_crypt_func) des_encrypt, (nettle_crypt_func *) des_encrypt,
(nettle_crypt_func) des_decrypt (nettle_crypt_func *) des_decrypt
}; };
const struct nettle_cipher const struct nettle_cipher
...@@ -75,8 +75,8 @@ nettle_des3 = { ...@@ -75,8 +75,8 @@ nettle_des3 = {
"des3", sizeof(struct des3_ctx), "des3", sizeof(struct des3_ctx),
DES3_BLOCK_SIZE, DES3_KEY_SIZE, DES3_BLOCK_SIZE, DES3_KEY_SIZE,
des3_set_key_hack, des3_set_key_hack, des3_set_key_hack, des3_set_key_hack,
(nettle_crypt_func) des3_encrypt, (nettle_crypt_func *) des3_encrypt,
(nettle_crypt_func) des3_decrypt (nettle_crypt_func *) des3_decrypt
}; };
/* NOTE: This is not as nice as one might think, as it will crash if /* NOTE: This is not as nice as one might think, as it will crash if
......
...@@ -32,19 +32,6 @@ ...@@ -32,19 +32,6 @@
extern "C" { extern "C" {
#endif #endif
/* Randomness. Used by key generation and dsa signature creation. */
typedef void (*nettle_random_func)(void *ctx,
unsigned length, uint8_t *dst);
/* Progress report function, mainly for key generation. */
typedef void (*nettle_progress_func)(void *ctx,
int c);
/* Ciphers */
typedef void (*nettle_set_key_func)(void *ctx,
unsigned length,
const uint8_t *key);
struct nettle_cipher struct nettle_cipher
{ {
...@@ -58,11 +45,11 @@ struct nettle_cipher ...@@ -58,11 +45,11 @@ struct nettle_cipher
/* Suggested key size; other sizes are sometimes possible. */ /* Suggested key size; other sizes are sometimes possible. */
unsigned key_size; unsigned key_size;
nettle_set_key_func set_encrypt_key; nettle_set_key_func *set_encrypt_key;
nettle_set_key_func set_decrypt_key; nettle_set_key_func *set_decrypt_key;
nettle_crypt_func encrypt; nettle_crypt_func *encrypt;
nettle_crypt_func decrypt; nettle_crypt_func *decrypt;
}; };
#define _NETTLE_CIPHER(name, NAME, keysize) { \ #define _NETTLE_CIPHER(name, NAME, keysize) { \
...@@ -70,10 +57,10 @@ struct nettle_cipher ...@@ -70,10 +57,10 @@ struct nettle_cipher
sizeof(struct name##_ctx), \ sizeof(struct name##_ctx), \
NAME##_BLOCK_SIZE, \ NAME##_BLOCK_SIZE, \
keysize / 8, \ keysize / 8, \
(nettle_set_key_func) name##_set_key, \ (nettle_set_key_func *) name##_set_key, \
(nettle_set_key_func) name##_set_key, \ (nettle_set_key_func *) name##_set_key, \
(nettle_crypt_func) name##_encrypt, \ (nettle_crypt_func *) name##_encrypt, \
(nettle_crypt_func) name##_decrypt, \ (nettle_crypt_func *) name##_decrypt, \
} }
#define _NETTLE_CIPHER_SEP(name, NAME, keysize) { \ #define _NETTLE_CIPHER_SEP(name, NAME, keysize) { \
...@@ -81,10 +68,10 @@ struct nettle_cipher ...@@ -81,10 +68,10 @@ struct nettle_cipher
sizeof(struct name##_ctx), \ sizeof(struct name##_ctx), \
NAME##_BLOCK_SIZE, \ NAME##_BLOCK_SIZE, \
keysize / 8, \ keysize / 8, \
(nettle_set_key_func) name##_set_encrypt_key, \ (nettle_set_key_func *) name##_set_encrypt_key, \
(nettle_set_key_func) name##_set_decrypt_key, \ (nettle_set_key_func *) name##_set_decrypt_key, \
(nettle_crypt_func) name##_encrypt, \ (nettle_crypt_func *) name##_encrypt, \
(nettle_crypt_func) name##_decrypt, \ (nettle_crypt_func *) name##_decrypt, \
} }
#define _NETTLE_CIPHER_FIX(name, NAME, keysize) { \ #define _NETTLE_CIPHER_FIX(name, NAME, keysize) { \
...@@ -92,10 +79,10 @@ struct nettle_cipher ...@@ -92,10 +79,10 @@ struct nettle_cipher
sizeof(struct name##_ctx), \ sizeof(struct name##_ctx), \
NAME##_BLOCK_SIZE, \ NAME##_BLOCK_SIZE, \
keysize / 8, \ keysize / 8, \
(nettle_set_key_func) name##_set_key, \ (nettle_set_key_func *) name##_set_key, \
(nettle_set_key_func) name##_set_key, \ (nettle_set_key_func *) name##_set_key, \
(nettle_crypt_func) name##_encrypt, \ (nettle_crypt_func *) name##_encrypt, \
(nettle_crypt_func) name##_decrypt, \ (nettle_crypt_func *) name##_decrypt, \
} }
extern const struct nettle_cipher nettle_aes128; extern const struct nettle_cipher nettle_aes128;
...@@ -118,15 +105,6 @@ extern const struct nettle_cipher nettle_arctwo64; ...@@ -118,15 +105,6 @@ extern const struct nettle_cipher nettle_arctwo64;
extern const struct nettle_cipher nettle_arctwo128; extern const struct nettle_cipher nettle_arctwo128;
extern const struct nettle_cipher nettle_arctwo_gutmann128; extern const struct nettle_cipher nettle_arctwo_gutmann128;
/* Hash algorithms */
typedef void (*nettle_hash_init_func)(void *ctx);
typedef void (*nettle_hash_update_func)(void *ctx,
unsigned length,
const uint8_t *src);
typedef void (*nettle_hash_digest_func)(void *ctx,
unsigned length, uint8_t *dst);
struct nettle_hash struct nettle_hash
{ {
const char *name; const char *name;
...@@ -140,9 +118,9 @@ struct nettle_hash ...@@ -140,9 +118,9 @@ struct nettle_hash
/* Internal block size */ /* Internal block size */
unsigned block_size; unsigned block_size;
nettle_hash_init_func init; nettle_hash_init_func *init;
nettle_hash_update_func update; nettle_hash_update_func *update;
nettle_hash_digest_func digest; nettle_hash_digest_func *digest;
}; };
#define _NETTLE_HASH(name, NAME) { \ #define _NETTLE_HASH(name, NAME) { \
...@@ -150,9 +128,9 @@ struct nettle_hash ...@@ -150,9 +128,9 @@ struct nettle_hash
sizeof(struct name##_ctx), \ sizeof(struct name##_ctx), \
NAME##_DIGEST_SIZE, \ NAME##_DIGEST_SIZE, \
NAME##_DATA_SIZE, \ NAME##_DATA_SIZE, \
(nettle_hash_init_func) name##_init, \ (nettle_hash_init_func *) name##_init, \
(nettle_hash_update_func) name##_update, \ (nettle_hash_update_func *) name##_update, \
(nettle_hash_digest_func) name##_digest \ (nettle_hash_digest_func *) name##_digest \
} }
extern const struct nettle_hash nettle_md2; extern const struct nettle_hash nettle_md2;
...@@ -161,27 +139,6 @@ extern const struct nettle_hash nettle_md5; ...@@ -161,27 +139,6 @@ extern const struct nettle_hash nettle_md5;
extern const struct nettle_hash nettle_sha1; extern const struct nettle_hash nettle_sha1;
extern const struct nettle_hash nettle_sha256; extern const struct nettle_hash nettle_sha256;
/* ASCII armor codecs. NOTE: Experimental and subject to change. */
typedef unsigned (*nettle_armor_length_func)(unsigned length);
typedef void (*nettle_armor_init_func)(void *ctx);
typedef unsigned (*nettle_armor_encode_update_func)(void *ctx,
uint8_t *dst,
unsigned src_length,
const uint8_t *src);
typedef unsigned (*nettle_armor_encode_final_func)(void *ctx, uint8_t *dst);
typedef int (*nettle_armor_decode_update_func)(void *ctx,
unsigned *dst_length,
uint8_t *dst,
unsigned src_length,
const uint8_t *src);
typedef int (*nettle_armor_decode_final_func)(void *ctx);
struct nettle_armor struct nettle_armor
{ {