diff options
Diffstat (limited to '')
| -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 8677713c8e..5ec8c08585 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.6 2025/05/19 06:47:40 beck Exp $ */ | 1 | /* $OpenBSD: mlkem_tests_util.c,v 1.7 2025/05/19 07:53:00 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> |
| @@ -61,25 +61,10 @@ compare_data(const uint8_t *want, const uint8_t *got, size_t len, const char *ms | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | int | 63 | int |
| 64 | mlkem768_encode_private_key(const void *private_key, uint8_t **out_buf, | 64 | mlkem768_marshal_private_key(const void *private_key, uint8_t **out_buf, |
| 65 | size_t *out_len) | 65 | size_t *out_len) |
| 66 | { | 66 | { |
| 67 | CBB cbb; | 67 | return MLKEM768_marshal_private_key(private_key, out_buf, out_len); |
| 68 | int ret = 0; | ||
| 69 | |||
| 70 | if (!CBB_init(&cbb, MLKEM768_PUBLIC_KEY_BYTES)) | ||
| 71 | goto err; | ||
| 72 | if (!MLKEM768_marshal_private_key(&cbb, private_key)) | ||
| 73 | goto err; | ||
| 74 | if (!CBB_finish(&cbb, out_buf, out_len)) | ||
| 75 | goto err; | ||
| 76 | |||
| 77 | ret = 1; | ||
| 78 | |||
| 79 | err: | ||
| 80 | CBB_cleanup(&cbb); | ||
| 81 | |||
| 82 | return ret; | ||
| 83 | } | 68 | } |
| 84 | 69 | ||
| 85 | int | 70 | int |
