diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/mlkem/mlkem_internal.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/libcrypto/mlkem/mlkem_internal.h b/src/lib/libcrypto/mlkem/mlkem_internal.h index d3f325932f..1e051970a8 100644 --- a/src/lib/libcrypto/mlkem/mlkem_internal.h +++ b/src/lib/libcrypto/mlkem/mlkem_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mlkem_internal.h,v 1.4 2024/12/19 23:52:26 tb Exp $ */ | 1 | /* $OpenBSD: mlkem_internal.h,v 1.7 2025/05/20 00:33:40 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023, Google Inc. | 3 | * Copyright (c) 2023, Google Inc. |
4 | * | 4 | * |
@@ -41,7 +41,7 @@ __BEGIN_HIDDEN_DECLS | |||
41 | * regular callers should use the non-deterministic |MLKEM_generate_key| | 41 | * regular callers should use the non-deterministic |MLKEM_generate_key| |
42 | * directly. | 42 | * directly. |
43 | */ | 43 | */ |
44 | void MLKEM768_generate_key_external_entropy( | 44 | int MLKEM768_generate_key_external_entropy( |
45 | uint8_t out_encoded_public_key[MLKEM768_PUBLIC_KEY_BYTES], | 45 | uint8_t out_encoded_public_key[MLKEM768_PUBLIC_KEY_BYTES], |
46 | struct MLKEM768_private_key *out_private_key, | 46 | struct MLKEM768_private_key *out_private_key, |
47 | const uint8_t entropy[MLKEM_SEED_BYTES]); | 47 | const uint8_t entropy[MLKEM_SEED_BYTES]); |
@@ -57,8 +57,8 @@ void MLKEM768_generate_key_external_entropy( | |||
57 | * format for ML-KEM private keys. It returns one on success or zero on | 57 | * format for ML-KEM private keys. It returns one on success or zero on |
58 | * allocation error. | 58 | * allocation error. |
59 | */ | 59 | */ |
60 | int MLKEM768_marshal_private_key(CBB *out, | 60 | int MLKEM768_marshal_private_key(const struct MLKEM768_private_key *private_key, |
61 | const struct MLKEM768_private_key *private_key); | 61 | uint8_t **out_private_key, size_t *out_private_key_len); |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * MLKEM_encap_external_entropy behaves like |MLKEM_encap|, but uses | 64 | * MLKEM_encap_external_entropy behaves like |MLKEM_encap|, but uses |
@@ -80,7 +80,7 @@ void MLKEM768_encap_external_entropy( | |||
80 | * regular callers should use the non-deterministic |MLKEM_generate_key| | 80 | * regular callers should use the non-deterministic |MLKEM_generate_key| |
81 | * directly. | 81 | * directly. |
82 | */ | 82 | */ |
83 | void MLKEM1024_generate_key_external_entropy( | 83 | int MLKEM1024_generate_key_external_entropy( |
84 | uint8_t out_encoded_public_key[MLKEM1024_PUBLIC_KEY_BYTES], | 84 | uint8_t out_encoded_public_key[MLKEM1024_PUBLIC_KEY_BYTES], |
85 | struct MLKEM1024_private_key *out_private_key, | 85 | struct MLKEM1024_private_key *out_private_key, |
86 | const uint8_t entropy[MLKEM_SEED_BYTES]); | 86 | const uint8_t entropy[MLKEM_SEED_BYTES]); |
@@ -96,8 +96,9 @@ void MLKEM1024_generate_key_external_entropy( | |||
96 | * standard format for ML-KEM private keys. It returns one on success or zero on | 96 | * standard format for ML-KEM private keys. It returns one on success or zero on |
97 | * allocation error. | 97 | * allocation error. |
98 | */ | 98 | */ |
99 | int MLKEM1024_marshal_private_key(CBB *out, | 99 | int MLKEM1024_marshal_private_key( |
100 | const struct MLKEM1024_private_key *private_key); | 100 | const struct MLKEM1024_private_key *private_key, uint8_t **out_private_key, |
101 | size_t *out_private_key_len); | ||
101 | 102 | ||
102 | /* | 103 | /* |
103 | * MLKEM_encap_external_entropy behaves like |MLKEM_encap|, but uses | 104 | * MLKEM_encap_external_entropy behaves like |MLKEM_encap|, but uses |