]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
blake2: add generated param decoder
authorPauli <ppzgs1@gmail.com>
Wed, 16 Jul 2025 00:49:49 +0000 (10:49 +1000)
committerPauli <ppzgs1@gmail.com>
Wed, 13 Aug 2025 01:49:43 +0000 (11:49 +1000)
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28142)

.gitignore
build.info
providers/implementations/include/prov/blake2_params.inc.in [new file with mode: 0644]

index a582368377bae64d9c9bfae9d94acfc4a2f9524e..2298f35f49334001c60a39429410b6de57a8293d 100644 (file)
@@ -112,6 +112,7 @@ providers/implementations/ciphers/cipher_chacha20_poly1305.c
 providers/implementations/digests/blake2_prov.c
 providers/implementations/digests/digestcommon.c
 providers/implementations/digests/sha3_prov.c
+providers/implementations/include/prov/blake2_params.inc
 providers/implementations/macs/cmac_prov.c
 providers/implementations/macs/gmac_prov.c
 providers/implementations/macs/hmac_prov.c
index f0b4fdd4661cdf7ffdc533802cb6a405b1eb40db..8e02ed11bdfc7109a8ed86c96befcf122a423d55 100644 (file)
@@ -74,9 +74,10 @@ DEPEND[]=include/openssl/asn1.h \
          providers/implementations/ciphers/cipher_chacha20_poly1305.c \
          providers/implementations/digests/blake2_prov.c \
          providers/implementations/digests/digestcommon.c \
-         providers/implementations/digests/sha3_prov.c
-         providers/implementations/macs/gmac_prov.c \
+         providers/implementations/digests/sha3_prov.c \
+         providers/implementations/include/prov/blake2_params.inc \
          providers/implementations/macs/cmac_prov.c \
+         providers/implementations/macs/gmac_prov.c \
          providers/implementations/macs/hmac_prov.c \
          providers/implementations/macs/kmac_prov.c \
          providers/implementations/macs/poly1305_prov.c \
@@ -142,6 +143,7 @@ DEPEND[providers/implementations/kdfs/argon2.c \
        providers/implementations/digests/blake2_prov.c \
        providers/implementations/digests/digestcommon.c \
        providers/implementations/digests/sha3_prov.c \
+       providers/implementations/include/prov/blake2_params.inc \
        providers/implementations/macs/cmac_prov.c \
        providers/implementations/macs/gmac_prov.c \
        providers/implementations/macs/hmac_prov.c \
@@ -203,6 +205,8 @@ GENERATE[providers/implementations/digests/digestcommon.c]=\
     providers/implementations/digests/digestcommon.c.in
 GENERATE[providers/implementations/digests/sha3_prov.c]=\
     providers/implementations/digests/sha3_prov.c.in
+GENERATE[providers/implementations/include/prov/blake2_params.inc]=\
+    providers/implementations/include/prov/blake2_params.inc.in
 GENERATE[providers/implementations/macs/cmac_prov.c]=\
     providers/implementations/macs/cmac_prov.c.in
 GENERATE[providers/implementations/macs/gmac_prov.c]=\
diff --git a/providers/implementations/include/prov/blake2_params.inc.in b/providers/implementations/include/prov/blake2_params.inc.in
new file mode 100644 (file)
index 0000000..cca0dcf
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+#include <string.h>
+#include "internal/common.h"
+
+{- produce_param_decoder('blake2_get_ctx',
+                         (['MAC_PARAM_SIZE',                    'size',   'size_t'],
+                          ['MAC_PARAM_BLOCK_SIZE',              'bsize',  'size_t'],
+                         )); -}
+
+{- produce_param_decoder('blake2_mac_set_ctx',
+                         (['MAC_PARAM_SIZE',    'size', 'size_t'],
+                          ['MAC_PARAM_KEY',     'key',  'octet_string'],
+                          ['MAC_PARAM_CUSTOM',  'cust', 'octet_string'],
+                          ['MAC_PARAM_SALT',    'salt', 'octet_string'],
+                         )); -}
+