I've done this change. I didn't dare push it to the master branch just
yet, so it's on a new branch "set_key-changes". The more interesting
pieces of the ChangeLog below.
Anyone who'd like to comment (or test) before I merge it to the master
branch?
One maybe questionable renaming was that for cast128. I'm not sure if
anyone is using cast5/cast128 with keys smaller than 128 bits. But I'd
expect it to be uncommon, and then it makes sense to me to use "cast128"
for the variant with 128 bit keys.
I now let "cast128_set_key" take a key of fixed size 128 bits (16
bytes), and then I named the variable key size function "cast5_set_key".
It just seemed a bit too awkward to name the fix-sized function
cast128_128_set_key. If we ever add a specific set_key function for,
e.g., 80-bit cast5/cast128, I think that could be named
"cast5_80_set_key".
Regards,
/Niels
2014-01-29 Niels Möller <nisse(a)lysator.liu.se>
* nettle-types.h (typedef nettle_set_key_func): Deleted length
argument.
* arctwo.c (arctwo40_set_key, arctwo64_set_key)
(arctwo128_set_key, arctwo128_set_key_gutmann): New functions.
* arctwo.h: Declare them.
* arctwo-meta.c (ARCTWO): New macro.
(nettle_arctwo40, nettle_arctwo64, nettle_arctwo128)
(nettle_arctwo_gutmann128): Use new _set_key functions.
* arcfour.h (ARCFOUR128_KEY_SIZE): New constant.
* arcfour.c (arcfour128_set_key): New function.
* arcfour-meta.c (nettle_arcfour128): Use arcfour128_set_key and
ARCFOUR128_KEY_SIZE.
* cast128.c (cast5_set_key): Renamed, was cast128_set_key.
(cast128_set_key): New definition, with fixed key size.
* cast128.h (CAST128_MIN_KEY_SIZE, CAST128_MAX_KEY_SIZE): Renamed
constants, to...
(CAST5_MIN_KEY_SIZE, CAST5_MAX_KEY_SIZE): ... new names.
* eax.h (EAX_SET_KEY): Deleted length argument.
* aes128-meta.c: Deleted _set_key wrappers.
* aes192-meta.c: Likewise.
* aes256-meta.c: Likewise.
* camellia128-meta.c: Likewise.
* camellia192-meta.c: Likewise.
* camellia256-meta.c: Likewise.
* gcm-aes128.c (gcm_aes128_set_key): Deleted length argument.
* gcm-aes192.c (gcm_aes192_set_key): Likewise.
* gcm-aes256.c (gcm_aes256_set_key): Likewise.
* gcm.h: Updated prototypes.
* serpent-set-key.c (serpent128_set_key, serpent192_set_key)
(serpent256_set_key): New functions.
* serpent.h: Declare new functions.
(SERPENT128_KEY_SIZE, SERPENT192_KEY_SIZE)
(SERPENT256_KEY_SIZE): New constants.
* serpent-meta.c (SERPENT): New macro.
(nettle_serpent128, nettle_serpent192, nettle_serpent256): Use new
_set_key functions.
* twofish-set-key.c (twofish128_set_key, twofish192_set_key)
(twofish256_set_key): New functions.
* twofish.h: Declare new functions.
(TWOFISH128_KEY_SIZE, TWOFISH192_KEY_SIZE)
(TWOFISH256_KEY_SIZE): New constants.
* twofish-meta.c (TWOFISH): New macro.
(nettle_twofish128, nettle_twofish192, nettle_twofish256): Use new
_set_key functions.
--
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.