diff options
Diffstat (limited to 'src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c')
-rw-r--r-- | src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c index 5ec8c08585..68bd5d4871 100644 --- a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c +++ b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mlkem_tests_util.c,v 1.7 2025/05/19 07:53:00 beck Exp $ */ | 1 | /* $OpenBSD: mlkem_tests_util.c,v 1.8 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> |
@@ -75,25 +75,10 @@ mlkem768_marshal_public_key(const void *public_key, uint8_t **out_buf, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | int | 77 | int |
78 | mlkem1024_encode_private_key(const void *private_key, uint8_t **out_buf, | 78 | mlkem1024_marshal_private_key(const void *private_key, uint8_t **out_buf, |
79 | size_t *out_len) | 79 | size_t *out_len) |
80 | { | 80 | { |
81 | CBB cbb; | 81 | return MLKEM1024_marshal_private_key(private_key, out_buf, out_len); |
82 | int ret = 0; | ||
83 | |||
84 | if (!CBB_init(&cbb, MLKEM1024_PUBLIC_KEY_BYTES)) | ||
85 | goto err; | ||
86 | if (!MLKEM1024_marshal_private_key(&cbb, private_key)) | ||
87 | goto err; | ||
88 | if (!CBB_finish(&cbb, out_buf, out_len)) | ||
89 | goto err; | ||
90 | |||
91 | ret = 1; | ||
92 | |||
93 | err: | ||
94 | CBB_cleanup(&cbb); | ||
95 | |||
96 | return ret; | ||
97 | } | 82 | } |
98 | 83 | ||
99 | int | 84 | int |