diff options
author | beck <> | 2025-08-14 15:48:48 +0000 |
---|---|---|
committer | beck <> | 2025-08-14 15:48:48 +0000 |
commit | 6452fa9fc6f33dac80ee572764b9fe29a469f8ce (patch) | |
tree | 0956ae670e4f193442bcf99d2b1fb70a43a6b5b5 /src/lib/libcrypto/hidden/openssl/mlkem.h | |
parent | 9bef27f78e41e8026f1d588e4e36e385061f3deb (diff) | |
download | openbsd-6452fa9fc6f33dac80ee572764b9fe29a469f8ce.tar.gz openbsd-6452fa9fc6f33dac80ee572764b9fe29a469f8ce.tar.bz2 openbsd-6452fa9fc6f33dac80ee572764b9fe29a469f8ce.zip |
Add a reasonable ML-KEM API for public use.
Adapt the tests to use this API.
This does not yet make the symbols public in Symbols.list
which will happen shortly with a bump.
This includes some partial rototilling of the non-public
interfaces which will be shortly continued when the internal
code is deduplicated to not have multiple copies for ML-KEM
768 and ML-KEM 1024 (which is just an artifact of unravelling
the boring C++ code).
ok jsing@, tb@
Diffstat (limited to 'src/lib/libcrypto/hidden/openssl/mlkem.h')
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/mlkem.h | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/lib/libcrypto/hidden/openssl/mlkem.h b/src/lib/libcrypto/hidden/openssl/mlkem.h index 8cd80eb3af..3807b3fa1e 100644 --- a/src/lib/libcrypto/hidden/openssl/mlkem.h +++ b/src/lib/libcrypto/hidden/openssl/mlkem.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* $OpenBSD: mlkem.h,v 1.4 2024/12/20 15:10:31 tb Exp $ */ | 1 | /* $OpenBSD: mlkem.h,v 1.5 2025/08/14 15:48:48 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Bob Beck <beck@obtuse.com> | 3 | * Copyright (c) 2025 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
5 | * Permission to use, copy, modify, and distribute this software for any | 5 | * Permission to use, copy, modify, and distribute this software for any |
6 | * purpose with or without fee is hereby granted, provided that the above | 6 | * purpose with or without fee is hereby granted, provided that the above |
@@ -18,9 +18,6 @@ | |||
18 | #ifndef _LIBCRYPTO_MLKEM_H | 18 | #ifndef _LIBCRYPTO_MLKEM_H |
19 | #define _LIBCRYPTO_MLKEM_H | 19 | #define _LIBCRYPTO_MLKEM_H |
20 | 20 | ||
21 | /* Undo when making public */ | ||
22 | #ifdef LIBRESSL_HAS_MLKEM | ||
23 | |||
24 | #ifndef _MSC_VER | 21 | #ifndef _MSC_VER |
25 | #include_next <openssl/mlkem.h> | 22 | #include_next <openssl/mlkem.h> |
26 | #else | 23 | #else |
@@ -28,22 +25,21 @@ | |||
28 | #endif | 25 | #endif |
29 | #include "crypto_namespace.h" | 26 | #include "crypto_namespace.h" |
30 | 27 | ||
31 | LCRYPTO_USED(MLKEM768_generate_key); | 28 | LCRYPTO_USED(MLKEM_private_key_new); |
32 | LCRYPTO_USED(MLKEM768_public_from_private); | 29 | LCRYPTO_USED(MLKEM_private_key_free); |
33 | LCRYPTO_USED(MLKEM768_encap); | 30 | LCRYPTO_USED(MLKEM_private_key_ciphertext_length); |
34 | LCRYPTO_USED(MLKEM768_decap); | 31 | LCRYPTO_USED(MLKEM_private_key_encoded_length); |
35 | LCRYPTO_USED(MLKEM768_marshal_public_key); | 32 | LCRYPTO_USED(MLKEM_public_key_new); |
36 | LCRYPTO_USED(MLKEM768_parse_public_key); | 33 | LCRYPTO_USED(MLKEM_public_key_free); |
37 | LCRYPTO_USED(MLKEM768_private_key_from_seed); | 34 | LCRYPTO_USED(MLKEM_public_key_ciphertext_length); |
38 | LCRYPTO_USED(MLKEM768_parse_private_key); | 35 | LCRYPTO_USED(MLKEM_public_key_encoded_length); |
39 | LCRYPTO_USED(MLKEM1024_generate_key); | 36 | LCRYPTO_USED(MLKEM_generate_key); |
40 | LCRYPTO_USED(MLKEM1024_public_from_private); | 37 | LCRYPTO_USED(MLKEM_private_key_from_seed); |
41 | LCRYPTO_USED(MLKEM1024_encap); | 38 | LCRYPTO_USED(MLKEM_public_from_private); |
42 | LCRYPTO_USED(MLKEM1024_decap); | 39 | LCRYPTO_USED(MLKEM_encap); |
43 | LCRYPTO_USED(MLKEM1024_marshal_public_key); | 40 | LCRYPTO_USED(MLKEM_decap); |
44 | LCRYPTO_USED(MLKEM1024_parse_public_key); | 41 | LCRYPTO_USED(MLKEM_marshal_public_key); |
45 | LCRYPTO_USED(MLKEM1024_private_key_from_seed); | 42 | LCRYPTO_USED(MLKEM_parse_public_key); |
46 | LCRYPTO_USED(MLKEM1024_parse_private_key); | 43 | LCRYPTO_USED(MLKEM_parse_private_key); |
47 | #endif /* LIBRESSL_HAS_MLKEM */ | ||
48 | 44 | ||
49 | #endif /* _LIBCRYPTO_MLKEM_H */ | 45 | #endif /* _LIBCRYPTO_MLKEM_H */ |