From c148759dc94794db3faa3ed556583b65d40ae799 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 10 May 2017 21:50:04 +0100 Subject: [PATCH] symm/hmac-def.h: Report key sizes as 16-bit quantities. Hash states can be huge. It was an obvious mistake defining the recommended key size in terms of the state size, but I can't change it now. --- symm/hmac-def.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/symm/hmac-def.h b/symm/hmac-def.h index 612cc996..8e869358 100644 --- a/symm/hmac-def.h +++ b/symm/hmac-def.h @@ -67,9 +67,13 @@ \ /* --- Useful constants --- */ \ \ -const octet pre##_hmackeysz[] = { KSZ_ANY, PRE##_STATESZ }; \ -const octet pre##_sslmackeysz[] = { KSZ_ANY, PRE##_STATESZ }; \ -const octet pre##_nmackeysz[] = { KSZ_SET, 2 * PRE##_STATESZ, 0 }; \ +const octet pre##_hmackeysz[] = \ + { KSZ_ANY | KSZ_16BIT, PRE##_STATESZ/256, PRE##_STATESZ%256 }; \ +const octet pre##_sslmackeysz[] = \ + { KSZ_ANY | KSZ_16BIT, PRE##_STATESZ/256, PRE##_STATESZ%256 }; \ +const octet pre##_nmackeysz[] = \ + { KSZ_SET | KSZ_16BIT, \ + 2*PRE##_STATESZ/256, 2*PRE##_STATESZ%256, 0, 0 }; \ \ /* --- @pre_nmacinit@ --- * \ * \ -- 2.11.0