summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c
diff options
context:
space:
mode:
authorbeck <>2025-05-20 00:33:41 +0000
committerbeck <>2025-05-20 00:33:41 +0000
commitb7d2b00a69a9fe4778d1d5eb40407b1bba0ea5a8 (patch)
treef450ccfc382edbfea6d9c43fe327c89137b6f196 /src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c
parent5b7f1ed9416db994bc8609108b201a62033ed7b6 (diff)
downloadopenbsd-b7d2b00a69a9fe4778d1d5eb40407b1bba0ea5a8.tar.gz
openbsd-b7d2b00a69a9fe4778d1d5eb40407b1bba0ea5a8.tar.bz2
openbsd-b7d2b00a69a9fe4778d1d5eb40407b1bba0ea5a8.zip
Make MLKEM1024_marshal_private_key consistent with the public_key funcitons
Even though this should remain internal, make it the same as the public key marshal function, and make the needed fallout changes in regress. ok kenjiro@, tb@
Diffstat (limited to 'src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c')
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c21
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
77int 77int
78mlkem1024_encode_private_key(const void *private_key, uint8_t **out_buf, 78mlkem1024_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
99int 84int