/src/openssl/crypto/ml_dsa/ml_dsa_hash.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H) |
11 | | #define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H |
12 | | |
13 | | #include <openssl/evp.h> |
14 | | |
15 | | static ossl_inline ossl_unused int |
16 | | shake_xof(EVP_MD_CTX *ctx, const EVP_MD *md, const uint8_t *in, size_t in_len, |
17 | | uint8_t *out, size_t out_len) |
18 | 0 | { |
19 | 0 | return (EVP_DigestInit_ex2(ctx, md, NULL) == 1 |
20 | 0 | && EVP_DigestUpdate(ctx, in, in_len) == 1 |
21 | 0 | && EVP_DigestSqueeze(ctx, out, out_len) == 1); |
22 | 0 | } Unexecuted instantiation: ml_dsa_encoders.c:shake_xof Unexecuted instantiation: ml_dsa_key.c:shake_xof Unexecuted instantiation: ml_dsa_sample.c:shake_xof Unexecuted instantiation: ml_dsa_sign.c:shake_xof |
23 | | |
24 | | static ossl_inline ossl_unused int |
25 | | shake_xof_2(EVP_MD_CTX *ctx, const EVP_MD *md, const uint8_t *in1, size_t in1_len, |
26 | | const uint8_t *in2, size_t in2_len, uint8_t *out, size_t out_len) |
27 | 0 | { |
28 | 0 | return EVP_DigestInit_ex2(ctx, md, NULL) |
29 | 0 | && EVP_DigestUpdate(ctx, in1, in1_len) |
30 | 0 | && EVP_DigestUpdate(ctx, in2, in2_len) |
31 | 0 | && EVP_DigestSqueeze(ctx, out, out_len); |
32 | 0 | } Unexecuted instantiation: ml_dsa_encoders.c:shake_xof_2 Unexecuted instantiation: ml_dsa_key.c:shake_xof_2 Unexecuted instantiation: ml_dsa_sample.c:shake_xof_2 Unexecuted instantiation: ml_dsa_sign.c:shake_xof_2 |
33 | | |
34 | | static ossl_inline ossl_unused int |
35 | | shake_xof_3(EVP_MD_CTX *ctx, const EVP_MD *md, const uint8_t *in1, size_t in1_len, |
36 | | const uint8_t *in2, size_t in2_len, |
37 | | const uint8_t *in3, size_t in3_len, uint8_t *out, size_t out_len) |
38 | 0 | { |
39 | 0 | return EVP_DigestInit_ex2(ctx, md, NULL) |
40 | 0 | && EVP_DigestUpdate(ctx, in1, in1_len) |
41 | 0 | && EVP_DigestUpdate(ctx, in2, in2_len) |
42 | 0 | && EVP_DigestUpdate(ctx, in3, in3_len) |
43 | 0 | && EVP_DigestSqueeze(ctx, out, out_len); |
44 | 0 | } Unexecuted instantiation: ml_dsa_encoders.c:shake_xof_3 Unexecuted instantiation: ml_dsa_key.c:shake_xof_3 Unexecuted instantiation: ml_dsa_sample.c:shake_xof_3 Unexecuted instantiation: ml_dsa_sign.c:shake_xof_3 |
45 | | |
46 | | #endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H) */ |