summaryrefslogtreecommitdiffstats
path: root/providers/implementations/macs/kmac_prov.c
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2022-12-15 18:57:09 +1000
committerTomas Mraz <tomas@openssl.org>2022-12-16 16:36:49 +0100
commit211c47ca1b1ac129dcee59d383cae44e36532bb9 (patch)
tree2e785913a515555bb576ec07d1eb30bdefab9a0a /providers/implementations/macs/kmac_prov.c
parentadf289b5b67ecb414ab709a2c25b0c6f0d463d31 (diff)
Add KMAC support to KBKDF.
Now that ACVP test vectors exist, support has been added for this mode. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-108r1.pdf Note that the test vectors used fairly large values for the input key and the context, so the contraints for these has been increased from 256 to 512 bytes. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19916)
Diffstat (limited to 'providers/implementations/macs/kmac_prov.c')
-rw-r--r--providers/implementations/macs/kmac_prov.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/providers/implementations/macs/kmac_prov.c b/providers/implementations/macs/kmac_prov.c
index 7c1ce18ac7..56d434a9ed 100644
--- a/providers/implementations/macs/kmac_prov.c
+++ b/providers/implementations/macs/kmac_prov.c
@@ -91,21 +91,21 @@ static OSSL_FUNC_mac_final_fn kmac_final;
* Restrict the maximum length of the customisation string. This must not
* exceed 64 bits = 8k bytes.
*/
-#define KMAC_MAX_CUSTOM 256
+#define KMAC_MAX_CUSTOM 512
/* Maximum size of encoded custom string */
#define KMAC_MAX_CUSTOM_ENCODED (KMAC_MAX_CUSTOM + KMAC_MAX_ENCODED_HEADER_LEN)
-/* Maximum key size in bytes = 256 (2048 bits) */
-#define KMAC_MAX_KEY 256
+/* Maximum key size in bytes = 512 (4096 bits) */
+#define KMAC_MAX_KEY 512
#define KMAC_MIN_KEY 4
/*
* Maximum Encoded Key size will be padded to a multiple of the blocksize
- * i.e KMAC_MAX_KEY + KMAC_MAX_ENCODED_HEADER_LEN = 256 + 4
+ * i.e KMAC_MAX_KEY + KMAC_MAX_ENCODED_HEADER_LEN = 512 + 4
* Padded to a multiple of KMAC_MAX_BLOCKSIZE
*/
-#define KMAC_MAX_KEY_ENCODED (KMAC_MAX_BLOCKSIZE * 2)
+#define KMAC_MAX_KEY_ENCODED (KMAC_MAX_BLOCKSIZE * 4)
/* Fixed value of encode_string("KMAC") */
static const unsigned char kmac_string[] = {