summaryrefslogtreecommitdiff
path: root/nettle-meta.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-02-11 18:45:36 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-02-11 18:45:36 +0100
commitdfe944a971512f413fc3c74ca8066ee7a70f6d5c (patch)
treeaad03b8c75875c0030f83b62a8b4d605bd57107e /nettle-meta.h
parentf6ad3413a9253e32a6d476bf633919d3d368c6b8 (diff)
downloadnettle-dfe944a971512f413fc3c74ca8066ee7a70f6d5c.tar.gz
(_NETTLE_CIPHER_FIX): New macro, suitable for
ciphers with a fixed key size. Rev: src/nettle/nettle-meta.h:1.5
Diffstat (limited to 'nettle-meta.h')
-rw-r--r--nettle-meta.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/nettle-meta.h b/nettle-meta.h
index 8283ed52..008047a1 100644
--- a/nettle-meta.h
+++ b/nettle-meta.h
@@ -67,7 +67,18 @@ struct nettle_cipher
(nettle_crypt_func) name##_encrypt, \
(nettle_crypt_func) name##_decrypt, \
}
-
+
+#define _NETTLE_CIPHER_FIX(name, NAME, keysize) { \
+ #name, \
+ sizeof(struct name##_ctx), \
+ NAME##_BLOCK_SIZE, \
+ keysize / 8, \
+ (nettle_set_key_func) name##_set_key, \
+ (nettle_set_key_func) name##_set_key, \
+ (nettle_crypt_func) name##_encrypt, \
+ (nettle_crypt_func) name##_decrypt, \
+}
+
extern const struct nettle_cipher nettle_aes128;
extern const struct nettle_cipher nettle_aes192;
extern const struct nettle_cipher nettle_aes256;