diff options
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/linux.yml | 12 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 24 | ||||
-rw-r--r-- | crypto/Makefile.am | 5 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-x86_64 | 10 | ||||
-rw-r--r-- | crypto/Makefile.am.macosx-x86_64 | 10 | ||||
-rw-r--r-- | include/arch/loongarch64/opensslconf.h | 10 | ||||
-rw-r--r-- | include/arch/mips/opensslconf.h | 10 | ||||
-rw-r--r-- | patches/crypto_namespace.h.patch | 22 | ||||
-rw-r--r-- | patches/mlkem_internal.h.patch | 11 | ||||
-rw-r--r-- | patches/ssl_namespace.h.patch | 21 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/mlkem_tests.bat | 63 | ||||
-rwxr-xr-x | update.sh | 2 |
16 files changed, 149 insertions, 74 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8334ae6..de9d8d3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml | |||
@@ -35,6 +35,13 @@ jobs: | |||
35 | - os: "ubuntu-24.04" # loong64 | 35 | - os: "ubuntu-24.04" # loong64 |
36 | arch: "loong64" | 36 | arch: "loong64" |
37 | compiler: "gcc" | 37 | compiler: "gcc" |
38 | - os: "ubuntu-24.04-arm" | ||
39 | arch: "native" | ||
40 | compiler: "gcc" | ||
41 | - os: "ubuntu-24.04-arm" | ||
42 | arch: "native" | ||
43 | compiler: "clang" | ||
44 | |||
38 | steps: | 45 | steps: |
39 | - name: "Checkout repository" | 46 | - name: "Checkout repository" |
40 | uses: actions/checkout@v4 | 47 | uses: actions/checkout@v4 |
@@ -47,8 +54,8 @@ jobs: | |||
47 | 54 | ||
48 | # Test ASAN with and without ASM enabled. | 55 | # Test ASAN with and without ASM enabled. |
49 | test-asan: | 56 | test-asan: |
50 | name: "ASAN (${{ matrix.asm == 'ON' && 'asm' || 'no-asm' }})" | 57 | name: "${{ matrix.os }} - ASAN (${{ matrix.asm == 'ON' && 'asm' || 'no-asm' }})" |
51 | runs-on: "ubuntu-24.04" | 58 | runs-on: "${{ matrix.os }}" |
52 | if: ${{ github.repository_owner == 'libressl' || github.event_name != 'schedule' }} | 59 | if: ${{ github.repository_owner == 'libressl' || github.event_name != 'schedule' }} |
53 | permissions: | 60 | permissions: |
54 | contents: read | 61 | contents: read |
@@ -56,6 +63,7 @@ jobs: | |||
56 | fail-fast: false | 63 | fail-fast: false |
57 | matrix: | 64 | matrix: |
58 | asm: [ON, OFF] | 65 | asm: [ON, OFF] |
66 | os: ["ubuntu-24.04", "ubuntu-24.04-arm"] | ||
59 | steps: | 67 | steps: |
60 | - name: "Checkout repository" | 68 | - name: "Checkout repository" |
61 | uses: actions/checkout@v4 | 69 | uses: actions/checkout@v4 |
@@ -108,6 +108,7 @@ tests/constraints* | |||
108 | tests/crypto_test* | 108 | tests/crypto_test* |
109 | tests/ctlog.conf | 109 | tests/ctlog.conf |
110 | tests/*.crt | 110 | tests/*.crt |
111 | tests/ec_arithmetic* | ||
111 | tests/ec_point_conversion* | 112 | tests/ec_point_conversion* |
112 | tests/ecc_cdh* | 113 | tests/ecc_cdh* |
113 | tests/evp_pkey_cleanup* | 114 | tests/evp_pkey_cleanup* |
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a035bb..17e5a0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -378,6 +378,16 @@ if(HAVE_NETINET_IP_H) | |||
378 | add_definitions(-DHAVE_NETINET_IP_H) | 378 | add_definitions(-DHAVE_NETINET_IP_H) |
379 | endif() | 379 | endif() |
380 | 380 | ||
381 | check_include_files(resolv.h HAVE_RESOLV_H) | ||
382 | if(HAVE_RESOLV_H) | ||
383 | add_definitions(-DHAVE_RESOLV_H) | ||
384 | endif() | ||
385 | |||
386 | check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H) | ||
387 | if(HAVE_ARPA_NAMESER_H) | ||
388 | add_definitions(-DHAVE_ARPA_NAMESER_H) | ||
389 | endif() | ||
390 | |||
381 | # This isn't ready for universal binaries yet, since we do conditional | 391 | # This isn't ready for universal binaries yet, since we do conditional |
382 | # compilation based on the architecture, but this makes cross compiling for a | 392 | # compilation based on the architecture, but this makes cross compiling for a |
383 | # single architecture work on macOS at least. | 393 | # single architecture work on macOS at least. |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 047c228..f67d2bd 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -33,11 +33,21 @@ if(HOST_ASM_ELF_X86_64) | |||
33 | bn/arch/amd64/bignum_add.S | 33 | bn/arch/amd64/bignum_add.S |
34 | bn/arch/amd64/bignum_cmadd.S | 34 | bn/arch/amd64/bignum_cmadd.S |
35 | bn/arch/amd64/bignum_cmul.S | 35 | bn/arch/amd64/bignum_cmul.S |
36 | bn/arch/amd64/bignum_modadd.S | ||
37 | bn/arch/amd64/bignum_modsub.S | ||
36 | bn/arch/amd64/bignum_mul.S | 38 | bn/arch/amd64/bignum_mul.S |
39 | bn/arch/amd64/bignum_mul_4_8.S | ||
37 | bn/arch/amd64/bignum_mul_4_8_alt.S | 40 | bn/arch/amd64/bignum_mul_4_8_alt.S |
41 | bn/arch/amd64/bignum_mul_6_12.S | ||
42 | bn/arch/amd64/bignum_mul_6_12_alt.S | ||
43 | bn/arch/amd64/bignum_mul_8_16.S | ||
38 | bn/arch/amd64/bignum_mul_8_16_alt.S | 44 | bn/arch/amd64/bignum_mul_8_16_alt.S |
39 | bn/arch/amd64/bignum_sqr.S | 45 | bn/arch/amd64/bignum_sqr.S |
46 | bn/arch/amd64/bignum_sqr_4_8.S | ||
40 | bn/arch/amd64/bignum_sqr_4_8_alt.S | 47 | bn/arch/amd64/bignum_sqr_4_8_alt.S |
48 | bn/arch/amd64/bignum_sqr_6_12.S | ||
49 | bn/arch/amd64/bignum_sqr_6_12_alt.S | ||
50 | bn/arch/amd64/bignum_sqr_8_16.S | ||
41 | bn/arch/amd64/bignum_sqr_8_16_alt.S | 51 | bn/arch/amd64/bignum_sqr_8_16_alt.S |
42 | bn/arch/amd64/bignum_sub.S | 52 | bn/arch/amd64/bignum_sub.S |
43 | bn/arch/amd64/word_clz.S | 53 | bn/arch/amd64/word_clz.S |
@@ -71,11 +81,21 @@ if(HOST_ASM_MACOSX_X86_64) | |||
71 | bn/arch/amd64/bignum_add.S | 81 | bn/arch/amd64/bignum_add.S |
72 | bn/arch/amd64/bignum_cmadd.S | 82 | bn/arch/amd64/bignum_cmadd.S |
73 | bn/arch/amd64/bignum_cmul.S | 83 | bn/arch/amd64/bignum_cmul.S |
84 | bn/arch/amd64/bignum_modadd.S | ||
85 | bn/arch/amd64/bignum_modsub.S | ||
74 | bn/arch/amd64/bignum_mul.S | 86 | bn/arch/amd64/bignum_mul.S |
87 | bn/arch/amd64/bignum_mul_4_8.S | ||
75 | bn/arch/amd64/bignum_mul_4_8_alt.S | 88 | bn/arch/amd64/bignum_mul_4_8_alt.S |
89 | bn/arch/amd64/bignum_mul_6_12.S | ||
90 | bn/arch/amd64/bignum_mul_6_12_alt.S | ||
91 | bn/arch/amd64/bignum_mul_8_16.S | ||
76 | bn/arch/amd64/bignum_mul_8_16_alt.S | 92 | bn/arch/amd64/bignum_mul_8_16_alt.S |
77 | bn/arch/amd64/bignum_sqr.S | 93 | bn/arch/amd64/bignum_sqr.S |
94 | bn/arch/amd64/bignum_sqr_4_8.S | ||
78 | bn/arch/amd64/bignum_sqr_4_8_alt.S | 95 | bn/arch/amd64/bignum_sqr_4_8_alt.S |
96 | bn/arch/amd64/bignum_sqr_6_12.S | ||
97 | bn/arch/amd64/bignum_sqr_6_12_alt.S | ||
98 | bn/arch/amd64/bignum_sqr_8_16.S | ||
79 | bn/arch/amd64/bignum_sqr_8_16_alt.S | 99 | bn/arch/amd64/bignum_sqr_8_16_alt.S |
80 | bn/arch/amd64/bignum_sub.S | 100 | bn/arch/amd64/bignum_sub.S |
81 | bn/arch/amd64/word_clz.S | 101 | bn/arch/amd64/word_clz.S |
@@ -416,8 +436,10 @@ set( | |||
416 | lhash/lhash.c | 436 | lhash/lhash.c |
417 | md4/md4.c | 437 | md4/md4.c |
418 | md5/md5.c | 438 | md5/md5.c |
419 | mlkem/mlkem768.c | 439 | mlkem/mlkem.c |
420 | mlkem/mlkem1024.c | 440 | mlkem/mlkem1024.c |
441 | mlkem/mlkem768.c | ||
442 | mlkem/mlkem_key.c | ||
421 | modes/cbc128.c | 443 | modes/cbc128.c |
422 | modes/ccm128.c | 444 | modes/ccm128.c |
423 | modes/cfb128.c | 445 | modes/cfb128.c |
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index ad241ab..610341a 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -738,9 +738,10 @@ libcrypto_la_SOURCES += md4/md4.c | |||
738 | libcrypto_la_SOURCES += md5/md5.c | 738 | libcrypto_la_SOURCES += md5/md5.c |
739 | 739 | ||
740 | # mlkem | 740 | # mlkem |
741 | libcrypto_la_SOURCES += mlkem/mlkem768.c | 741 | libcrypto_la_SOURCES += mlkem/mlkem.c |
742 | libcrypto_la_SOURCES += mlkem/mlkem1024.c | 742 | libcrypto_la_SOURCES += mlkem/mlkem1024.c |
743 | noinst_HEADERS += mlkem/mlkem.h | 743 | libcrypto_la_SOURCES += mlkem/mlkem768.c |
744 | libcrypto_la_SOURCES += mlkem/mlkem_key.c | ||
744 | noinst_HEADERS += mlkem/mlkem_internal.h | 745 | noinst_HEADERS += mlkem/mlkem_internal.h |
745 | 746 | ||
746 | # modes | 747 | # modes |
diff --git a/crypto/Makefile.am.elf-x86_64 b/crypto/Makefile.am.elf-x86_64 index ad49787..df67ad2 100644 --- a/crypto/Makefile.am.elf-x86_64 +++ b/crypto/Makefile.am.elf-x86_64 | |||
@@ -10,11 +10,21 @@ ASM_X86_64_ELF += rc4/rc4-elf-x86_64.S | |||
10 | ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S | 10 | ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S |
11 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S | 11 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S |
12 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmul.S | 12 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmul.S |
13 | ASM_X86_64_ELF += bn/arch/amd64/bignum_modadd.S | ||
14 | ASM_X86_64_ELF += bn/arch/amd64/bignum_modsub.S | ||
13 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul.S | 15 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul.S |
16 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_4_8.S | ||
14 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_4_8_alt.S | 17 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_4_8_alt.S |
18 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_6_12.S | ||
19 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_6_12_alt.S | ||
20 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_8_16.S | ||
15 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_8_16_alt.S | 21 | ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_8_16_alt.S |
16 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr.S | 22 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr.S |
23 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_4_8.S | ||
17 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_4_8_alt.S | 24 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_4_8_alt.S |
25 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_6_12.S | ||
26 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_6_12_alt.S | ||
27 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16.S | ||
18 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16_alt.S | 28 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16_alt.S |
19 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sub.S | 29 | ASM_X86_64_ELF += bn/arch/amd64/bignum_sub.S |
20 | ASM_X86_64_ELF += bn/arch/amd64/word_clz.S | 30 | ASM_X86_64_ELF += bn/arch/amd64/word_clz.S |
diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64 index bbccfd6..23e27e6 100644 --- a/crypto/Makefile.am.macosx-x86_64 +++ b/crypto/Makefile.am.macosx-x86_64 | |||
@@ -10,11 +10,21 @@ ASM_X86_64_MACOSX += rc4/rc4-macosx-x86_64.S | |||
10 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S | 10 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S |
11 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S | 11 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S |
12 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmul.S | 12 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmul.S |
13 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_modadd.S | ||
14 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_modsub.S | ||
13 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul.S | 15 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul.S |
16 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_4_8.S | ||
14 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_4_8_alt.S | 17 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_4_8_alt.S |
18 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_6_12.S | ||
19 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_6_12_alt.S | ||
20 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_8_16.S | ||
15 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_8_16_alt.S | 21 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_8_16_alt.S |
16 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr.S | 22 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr.S |
23 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_4_8.S | ||
17 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_4_8_alt.S | 24 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_4_8_alt.S |
25 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_6_12.S | ||
26 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_6_12_alt.S | ||
27 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16.S | ||
18 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16_alt.S | 28 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16_alt.S |
19 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sub.S | 29 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sub.S |
20 | ASM_X86_64_MACOSX += bn/arch/amd64/word_clz.S | 30 | ASM_X86_64_MACOSX += bn/arch/amd64/word_clz.S |
diff --git a/include/arch/loongarch64/opensslconf.h b/include/arch/loongarch64/opensslconf.h index 868066c..c31bcc0 100644 --- a/include/arch/loongarch64/opensslconf.h +++ b/include/arch/loongarch64/opensslconf.h | |||
@@ -11,13 +11,3 @@ | |||
11 | #define OPENSSL_LINE __LINE__ | 11 | #define OPENSSL_LINE __LINE__ |
12 | #endif | 12 | #endif |
13 | #endif | 13 | #endif |
14 | |||
15 | #if defined(HEADER_RC4_H) | ||
16 | #if !defined(RC4_CHUNK) | ||
17 | /* | ||
18 | * This enables code handling data aligned at natural CPU word | ||
19 | * boundary. See crypto/rc4/rc4_enc.c for further details. | ||
20 | */ | ||
21 | #define RC4_CHUNK unsigned long | ||
22 | #endif | ||
23 | #endif | ||
diff --git a/include/arch/mips/opensslconf.h b/include/arch/mips/opensslconf.h index dcbe113..c31bcc0 100644 --- a/include/arch/mips/opensslconf.h +++ b/include/arch/mips/opensslconf.h | |||
@@ -11,13 +11,3 @@ | |||
11 | #define OPENSSL_LINE __LINE__ | 11 | #define OPENSSL_LINE __LINE__ |
12 | #endif | 12 | #endif |
13 | #endif | 13 | #endif |
14 | |||
15 | #if defined(HEADER_RC4_H) | ||
16 | #if !defined(RC4_CHUNK) | ||
17 | /* | ||
18 | * This enables code handling data aligned at natural CPU word | ||
19 | * boundary. See crypto/rc4/rc4_enc.c for further details. | ||
20 | */ | ||
21 | #undef RC4_CHUNK | ||
22 | #endif | ||
23 | #endif | ||
diff --git a/patches/crypto_namespace.h.patch b/patches/crypto_namespace.h.patch deleted file mode 100644 index 400030f..0000000 --- a/patches/crypto_namespace.h.patch +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --- crypto/hidden/crypto_namespace.h.orig Fri Aug 2 23:52:55 2024 | ||
2 | +++ crypto/hidden/crypto_namespace.h Fri Aug 2 23:53:17 2024 | ||
3 | @@ -24,6 +24,12 @@ | ||
4 | * external calls use the latter name. | ||
5 | */ | ||
6 | |||
7 | +#ifdef _MSC_VER | ||
8 | +# define LCRYPTO_UNUSED(x) | ||
9 | +# define LCRYPTO_USED(x) | ||
10 | +# define LCRYPTO_ALIAS1(pre, x) | ||
11 | +# define LCRYPTO_ALIAS(x) | ||
12 | +#else | ||
13 | #ifdef LIBRESSL_NAMESPACE | ||
14 | #ifdef LIBRESSL_CRYPTO_NAMESPACE | ||
15 | # define LCRYPTO_UNUSED(x) __attribute__((deprecated)) \ | ||
16 | @@ -47,5 +53,6 @@ | ||
17 | # define LCRYPTO_ALIAS1(pre,x) | ||
18 | # define LCRYPTO_ALIAS(x) asm("") | ||
19 | #endif | ||
20 | +#endif /* _MSC_VER */ | ||
21 | |||
22 | #endif /* _LIBCRYPTO_CRYPTO_NAMESPACE_H_ */ | ||
diff --git a/patches/mlkem_internal.h.patch b/patches/mlkem_internal.h.patch new file mode 100644 index 0000000..b7cbdcf --- /dev/null +++ b/patches/mlkem_internal.h.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- crypto/mlkem/mlkem_internal.h.orig Sun Aug 17 13:20:18 2025 | ||
2 | +++ crypto/mlkem/mlkem_internal.h Sun Aug 17 13:20:37 2025 | ||
3 | @@ -19,7 +19,7 @@ | ||
4 | #define OPENSSL_HEADER_CRYPTO_MLKEM_INTERNAL_H | ||
5 | |||
6 | #include "bytestring.h" | ||
7 | -#include "mlkem.h" | ||
8 | +#include <openssl/mlkem.h> | ||
9 | |||
10 | #if defined(__cplusplus) | ||
11 | extern "C" { | ||
diff --git a/patches/ssl_namespace.h.patch b/patches/ssl_namespace.h.patch deleted file mode 100644 index eb9c7a2..0000000 --- a/patches/ssl_namespace.h.patch +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | --- ssl/hidden/ssl_namespace.h.orig Fri Aug 2 23:52:55 2024 | ||
2 | +++ ssl/hidden/ssl_namespace.h Fri Aug 2 23:53:17 2024 | ||
3 | @@ -23,6 +23,11 @@ | ||
4 | * and we alias that to the normal name. | ||
5 | */ | ||
6 | |||
7 | +#ifdef _MSC_VER | ||
8 | +#define LSSL_UNUSED(x) | ||
9 | +#define LSSL_USED(x) | ||
10 | +#define LSSL_ALIAS(x) | ||
11 | +#else | ||
12 | #ifdef LIBRESSL_NAMESPACE | ||
13 | #define LSSL_UNUSED(x) typeof(x) x __attribute__((deprecated)) | ||
14 | #define LSSL_USED(x) __attribute__((visibility("hidden"))) \ | ||
15 | @@ -37,5 +42,6 @@ | ||
16 | #define LSSL_USED(x) | ||
17 | #define LSSL_ALIAS(x) asm("") | ||
18 | #endif | ||
19 | +#endif /* _MSC_VER */ | ||
20 | |||
21 | #endif /* _LIBSSL_SSL_NAMESPACE_H_ */ | ||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c497b77..55529cd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -563,14 +563,16 @@ if(NOT WIN32) | |||
563 | endif() | 563 | endif() |
564 | 564 | ||
565 | # mlkem_tests | 565 | # mlkem_tests |
566 | add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c) | 566 | add_executable(mlkem_tests mlkem_tests.c parse_test_file.c) |
567 | target_link_libraries(mlkem_tests ${OPENSSL_TEST_LIBS}) | 567 | target_link_libraries(mlkem_tests ${OPENSSL_TEST_LIBS}) |
568 | prepare_emscripten_test_target(mlkem_tests) | 568 | prepare_emscripten_test_target(mlkem_tests) |
569 | if(NOT WIN32) | 569 | if(NOT MSVC) |
570 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.sh) | 570 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.sh) |
571 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | 571 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
572 | else() | ||
573 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.bat $<TARGET_FILE:mlkem_tests>) | ||
572 | endif() | 574 | endif() |
573 | # XXX - add tests for Windows | 575 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
574 | 576 | ||
575 | # mlkem_iteration_tests | 577 | # mlkem_iteration_tests |
576 | add_executable(mlkem_iteration_tests mlkem_iteration_tests.c mlkem_tests_util.c) | 578 | add_executable(mlkem_iteration_tests mlkem_iteration_tests.c mlkem_tests_util.c) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index 914b1e5..066e020 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -577,8 +577,8 @@ noinst_HEADERS += parse_test_file.h | |||
577 | # mlkem_tests | 577 | # mlkem_tests |
578 | TESTS += mlkem_tests.sh | 578 | TESTS += mlkem_tests.sh |
579 | check_PROGRAMS += mlkem_tests | 579 | check_PROGRAMS += mlkem_tests |
580 | mlkem_tests_SOURCES = mlkem_tests.c mlkem_tests_util.c parse_test_file.c | 580 | mlkem_tests_SOURCES = mlkem_tests.c parse_test_file.c |
581 | EXTRA_DIST += mlkem_tests.sh | 581 | EXTRA_DIST += mlkem_tests.sh mlkem_tests.bat |
582 | EXTRA_DIST += mlkem768_decap_tests.txt | 582 | EXTRA_DIST += mlkem768_decap_tests.txt |
583 | EXTRA_DIST += mlkem768_encap_tests.txt | 583 | EXTRA_DIST += mlkem768_encap_tests.txt |
584 | EXTRA_DIST += mlkem768_keygen_tests.txt | 584 | EXTRA_DIST += mlkem768_keygen_tests.txt |
diff --git a/tests/mlkem_tests.bat b/tests/mlkem_tests.bat new file mode 100644 index 0000000..618c9e0 --- /dev/null +++ b/tests/mlkem_tests.bat | |||
@@ -0,0 +1,63 @@ | |||
1 | @echo off | ||
2 | setlocal enabledelayedexpansion | ||
3 | |||
4 | :: Copyright (c) 2025 Theo Beuhler | ||
5 | :: | ||
6 | :: Permission to use, copy, modify, and distribute this software for any | ||
7 | :: purpose with or without fee is hereby granted, provided that the above | ||
8 | :: copyright notice and this permission notice appear in all copies. | ||
9 | :: | ||
10 | :: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
11 | :: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
12 | :: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
13 | :: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
14 | :: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
15 | :: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
16 | :: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
17 | |||
18 | set mlkem_tests_bin=%1 | ||
19 | set mlkem_tests_bin=%mlkem_tests_bin:/=\% | ||
20 | if not exist %mlkem_tests_bin% exit /b 1 | ||
21 | |||
22 | %mlkem_tests_bin% mlkem768_decap_tests %srcdir%\mlkem768_decap_tests.txt | ||
23 | if !errorlevel! neq 0 ( | ||
24 | exit /b 1 | ||
25 | ) | ||
26 | %mlkem_tests_bin% mlkem768_encap_tests %srcdir%\mlkem768_encap_tests.txt | ||
27 | if !errorlevel! neq 0 ( | ||
28 | exit /b 1 | ||
29 | ) | ||
30 | %mlkem_tests_bin% mlkem768_keygen_tests %srcdir%\mlkem768_keygen_tests.txt | ||
31 | if !errorlevel! neq 0 ( | ||
32 | exit /b 1 | ||
33 | ) | ||
34 | %mlkem_tests_bin% mlkem768_nist_decap_tests %srcdir%\mlkem768_nist_decap_tests.txt | ||
35 | if !errorlevel! neq 0 ( | ||
36 | exit /b 1 | ||
37 | ) | ||
38 | %mlkem_tests_bin% mlkem768_nist_keygen_tests %srcdir%\mlkem768_nist_keygen_tests.txt | ||
39 | if !errorlevel! neq 0 ( | ||
40 | exit /b 1 | ||
41 | ) | ||
42 | %mlkem_tests_bin% mlkem1024_decap_tests %srcdir%\mlkem1024_decap_tests.txt | ||
43 | if !errorlevel! neq 0 ( | ||
44 | exit /b 1 | ||
45 | ) | ||
46 | %mlkem_tests_bin% mlkem1024_encap_tests %srcdir%\mlkem1024_encap_tests.txt | ||
47 | if !errorlevel! neq 0 ( | ||
48 | exit /b 1 | ||
49 | ) | ||
50 | %mlkem_tests_bin% mlkem1024_keygen_tests %srcdir%\mlkem1024_keygen_tests.txt | ||
51 | if !errorlevel! neq 0 ( | ||
52 | exit /b 1 | ||
53 | ) | ||
54 | %mlkem_tests_bin% mlkem1024_nist_decap_tests %srcdir%\mlkem1024_nist_decap_tests.txt | ||
55 | if !errorlevel! neq 0 ( | ||
56 | exit /b 1 | ||
57 | ) | ||
58 | %mlkem_tests_bin% mlkem1024_nist_keygen_tests %srcdir%\mlkem1024_nist_keygen_tests.txt | ||
59 | if !errorlevel! neq 0 ( | ||
60 | exit /b 1 | ||
61 | ) | ||
62 | |||
63 | endlocal | ||
@@ -142,7 +142,7 @@ copy_hdrs $libcrypto_src "stack/stack.h lhash/lhash.h stack/safestack.h | |||
142 | ossl_typ.h err/err.h crypto.h comp/comp.h x509/x509.h buffer/buffer.h | 142 | ossl_typ.h err/err.h crypto.h comp/comp.h x509/x509.h buffer/buffer.h |
143 | objects/objects.h asn1/asn1.h asn1/posix_time.h bn/bn.h ec/ec.h ecdsa/ecdsa.h | 143 | objects/objects.h asn1/asn1.h asn1/posix_time.h bn/bn.h ec/ec.h ecdsa/ecdsa.h |
144 | ecdh/ecdh.h rsa/rsa.h sha/sha.h x509/x509_vfy.h pkcs7/pkcs7.h pem/pem.h | 144 | ecdh/ecdh.h rsa/rsa.h sha/sha.h x509/x509_vfy.h pkcs7/pkcs7.h pem/pem.h |
145 | hkdf/hkdf.h hmac/hmac.h rand/rand.h md5/md5.h | 145 | hkdf/hkdf.h hmac/hmac.h rand/rand.h md5/md5.h mlkem/mlkem.h |
146 | x509/x509v3.h conf/conf.h ocsp/ocsp.h | 146 | x509/x509v3.h conf/conf.h ocsp/ocsp.h |
147 | aes/aes.h modes/modes.h asn1/asn1t.h bf/blowfish.h | 147 | aes/aes.h modes/modes.h asn1/asn1t.h bf/blowfish.h |
148 | bio/bio.h cast/cast.h cmac/cmac.h cms/cms.h des/des.h dh/dh.h | 148 | bio/bio.h cast/cast.h cmac/cmac.h cms/cms.h des/des.h dh/dh.h |