diff options
Diffstat (limited to 'src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c')
-rw-r--r-- | src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c index 5a61248090..b93243023c 100644 --- a/src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c +++ b/src/regress/lib/libcrypto/mlkem/mlkem_iteration_tests.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mlkem_iteration_tests.c,v 1.2 2024/12/26 07:26:45 tb Exp $ */ | 1 | /* $OpenBSD: mlkem_iteration_tests.c,v 1.5 2025/05/20 00:33:41 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Google Inc. | 3 | * Copyright (c) 2024 Google Inc. |
4 | * Copyright (c) 2024 Bob Beck <beck@obtuse.com> | 4 | * Copyright (c) 2024 Bob Beck <beck@obtuse.com> |
@@ -73,7 +73,7 @@ struct iteration_ctx { | |||
73 | void *priv; | 73 | void *priv; |
74 | void *pub; | 74 | void *pub; |
75 | 75 | ||
76 | mlkem_encode_private_key_fn encode_private_key; | 76 | mlkem_marshal_private_key_fn marshal_private_key; |
77 | mlkem_encap_external_entropy_fn encap_external_entropy; | 77 | mlkem_encap_external_entropy_fn encap_external_entropy; |
78 | mlkem_generate_key_external_entropy_fn generate_key_external_entropy; | 78 | mlkem_generate_key_external_entropy_fn generate_key_external_entropy; |
79 | mlkem_public_from_private_fn public_from_private; | 79 | mlkem_public_from_private_fn public_from_private; |
@@ -116,8 +116,10 @@ MlkemIterativeTest(struct iteration_ctx *ctx) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | /* generate ek as encoded_public_key */ | 118 | /* generate ek as encoded_public_key */ |
119 | ctx->generate_key_external_entropy(ctx->encoded_public_key, | 119 | if (!ctx->generate_key_external_entropy(ctx->encoded_public_key, |
120 | ctx->priv, seed); | 120 | ctx->priv, seed)) { |
121 | errx(1, "generate_key_external_entropy"); | ||
122 | } | ||
121 | ctx->public_from_private(ctx->pub, ctx->priv); | 123 | ctx->public_from_private(ctx->pub, ctx->priv); |
122 | 124 | ||
123 | /* hash in ek */ | 125 | /* hash in ek */ |
@@ -125,7 +127,7 @@ MlkemIterativeTest(struct iteration_ctx *ctx) | |||
125 | ctx->encoded_public_key_len); | 127 | ctx->encoded_public_key_len); |
126 | 128 | ||
127 | /* marshal priv to dk as encoded_private_key */ | 129 | /* marshal priv to dk as encoded_private_key */ |
128 | if (!ctx->encode_private_key(ctx->priv, &encoded_private_key, | 130 | if (!ctx->marshal_private_key(ctx->priv, &encoded_private_key, |
129 | &encoded_private_key_len)) | 131 | &encoded_private_key_len)) |
130 | errx(1, "encode private key"); | 132 | errx(1, "encode private key"); |
131 | 133 | ||
@@ -183,7 +185,7 @@ main(void) | |||
183 | .priv = &priv768, | 185 | .priv = &priv768, |
184 | .pub = &pub768, | 186 | .pub = &pub768, |
185 | .encap_external_entropy = mlkem768_encap_external_entropy, | 187 | .encap_external_entropy = mlkem768_encap_external_entropy, |
186 | .encode_private_key = mlkem768_encode_private_key, | 188 | .marshal_private_key = mlkem768_marshal_private_key, |
187 | .generate_key_external_entropy = | 189 | .generate_key_external_entropy = |
188 | mlkem768_generate_key_external_entropy, | 190 | mlkem768_generate_key_external_entropy, |
189 | .public_from_private = mlkem768_public_from_private, | 191 | .public_from_private = mlkem768_public_from_private, |
@@ -208,7 +210,7 @@ main(void) | |||
208 | .priv = &priv1024, | 210 | .priv = &priv1024, |
209 | .pub = &pub1024, | 211 | .pub = &pub1024, |
210 | .encap_external_entropy = mlkem1024_encap_external_entropy, | 212 | .encap_external_entropy = mlkem1024_encap_external_entropy, |
211 | .encode_private_key = mlkem1024_encode_private_key, | 213 | .marshal_private_key = mlkem1024_marshal_private_key, |
212 | .generate_key_external_entropy = | 214 | .generate_key_external_entropy = |
213 | mlkem1024_generate_key_external_entropy, | 215 | mlkem1024_generate_key_external_entropy, |
214 | .public_from_private = mlkem1024_public_from_private, | 216 | .public_from_private = mlkem1024_public_from_private, |