From d6c88e2e507b72c0072306b9c54c33a240238f26 Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 4 Jun 2006 14:20:47 +0000 Subject: - Add defines with hash length for each hash algorithm. - Add defines with block length for each HMAC algorithm. - Add AES_BLOCK_LEN define which is an alias for RIJNDAEL128_BLOCK_LEN. - Add NULL_BLOCK_LEN define. --- sys/opencrypto/cryptodev.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'sys/opencrypto') diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index 6408eb4..bacecb3 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -61,19 +61,39 @@ #define CRYPTO_DRIVERS_INITIAL 4 #define CRYPTO_SW_SESSIONS 32 +/* Hash values */ +#define NULL_HASH_LEN 16 +#define MD5_HASH_LEN 16 +#define SHA1_HASH_LEN 20 +#define RIPEMD160_HASH_LEN 20 +#define SHA2_256_HASH_LEN 32 +#define SHA2_384_HASH_LEN 48 +#define SHA2_512_HASH_LEN 64 +#define MD5_KPDK_HASH_LEN 16 +#define SHA1_KPDK_HASH_LEN 20 + /* HMAC values */ -#define HMAC_BLOCK_LEN 64 -#define HMAC_BLOCK_MAXLEN 128 -#define HMAC_IPAD_VAL 0x36 -#define HMAC_OPAD_VAL 0x5C +#define NULL_HMAC_BLOCK_LEN 64 +#define MD5_HMAC_BLOCK_LEN 64 +#define SHA1_HMAC_BLOCK_LEN 64 +#define RIPEMD160_HMAC_BLOCK_LEN 64 +#define SHA2_256_HMAC_BLOCK_LEN 64 +#define SHA2_384_HMAC_BLOCK_LEN 128 +#define SHA2_512_HMAC_BLOCK_LEN 128 +#define HMAC_BLOCK_LEN 64 +#define HMAC_BLOCK_MAXLEN 128 +#define HMAC_IPAD_VAL 0x36 +#define HMAC_OPAD_VAL 0x5C /* Encryption algorithm block sizes */ +#define NULL_BLOCK_LEN 4 #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 #define SKIPJACK_BLOCK_LEN 8 #define CAST128_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 +#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN #define EALG_MAX_BLOCK_LEN 16 /* Keep this updated */ /* Maximum hash algorithm result length */ -- cgit v1.1