]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(_NETTLE_CIPHER_FIX): New macro, suitable for
authorNiels Möller <nisse@lysator.liu.se>
Mon, 11 Feb 2002 17:45:36 +0000 (18:45 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 11 Feb 2002 17:45:36 +0000 (18:45 +0100)
ciphers with a fixed key size.

Rev: src/nettle/nettle-meta.h:1.5

nettle-meta.h

index 8283ed525d6a3b53850ea02d76b017427b2e70bf..008047a1999976cc8cae50974f37cce72ea4b937 100644 (file)
@@ -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;