summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-12-14 19:16:24 +0000
committertb <>2024-12-14 19:16:24 +0000
commit51b4fa235035070c2f38cf0708c8c1577b4b621f (patch)
treea7eb0af27b6eacab7be47cdbe0cfb903a6bd1ea6 /src
parentd9dfb4af218b8d9fe842f363b39f2dc52cc54fc3 (diff)
downloadopenbsd-51b4fa235035070c2f38cf0708c8c1577b4b621f.tar.gz
openbsd-51b4fa235035070c2f38cf0708c8c1577b4b621f.tar.bz2
openbsd-51b4fa235035070c2f38cf0708c8c1577b4b621f.zip
Normalize top of files
RCS marker, KNF for comment, fix and sort includes as usual.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_decap_tests.c18
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_encap_tests.c18
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_iteration_test.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_keygen_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_nist_decap_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem1024_nist_keygen_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_decap_tests.c18
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_encap_tests.c18
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_iteration_test.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_keygen_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_nist_decap_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem768_nist_keygen_tests.c17
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c10
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem_tests_util.h14
-rw-r--r--src/regress/lib/libcrypto/mlkem/mlkem_unittest.c15
15 files changed, 138 insertions, 109 deletions
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_decap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_decap_tests.c
index 816bc154ab..b38cd52d28 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_decap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_decap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_decap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,17 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28 28
29static void 29static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_encap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_encap_tests.c
index 3547a0a6e0..83924ba6d2 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_encap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_encap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_encap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,17 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28 28
29static void 29static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_iteration_test.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_iteration_test.c
index d44156e715..2b03a724ab 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_iteration_test.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_iteration_test.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_iteration_test.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,18 +13,19 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <stdlib.h> 19#include <stdint.h>
17#include <stdio.h> 20#include <stdio.h>
18#include <string.h> 21#include <stdlib.h>
19 22
20#include "bytestring.h" 23#include <openssl/bytestring.h>
24#include <openssl/mlkem.h>
21 25
22#include "sha3_internal.h"
23#include "mlkem.h"
24#include "mlkem_internal.h" 26#include "mlkem_internal.h"
25#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28#include "sha3_internal.h"
26 29
27static int 30static int
28encode_private_key(const struct MLKEM1024_private_key *priv, uint8_t **out_buf, 31encode_private_key(const struct MLKEM1024_private_key *priv, uint8_t **out_buf,
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_keygen_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_keygen_tests.c
index 94df22b030..d27d5aacf9 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_keygen_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_keygen_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_keygen_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static int 30static int
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_decap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_decap_tests.c
index 3f71a79dc7..a59d062234 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_decap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_decap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_nist_decap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static void 30static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_keygen_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_keygen_tests.c
index aeef6dfa5a..b9600dc6b5 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_keygen_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem1024_nist_keygen_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem1024_nist_keygen_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static int 30static int
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_decap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem768_decap_tests.c
index 3527a0f842..96dc435c4d 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_decap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_decap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_decap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,17 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28 28
29static void 29static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_encap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem768_encap_tests.c
index 2f6ad896c6..be6c6149da 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_encap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_encap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_encap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,17 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28 28
29static void 29static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_iteration_test.c b/src/regress/lib/libcrypto/mlkem/mlkem768_iteration_test.c
index 4df8171273..e9866134eb 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_iteration_test.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_iteration_test.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_iteration_test.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,18 +13,19 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <stdlib.h> 19#include <stdint.h>
17#include <stdio.h> 20#include <stdio.h>
18#include <string.h> 21#include <stdlib.h>
19 22
20#include "bytestring.h" 23#include <openssl/bytestring.h>
24#include <openssl/mlkem.h>
21 25
22#include "sha3_internal.h"
23#include "mlkem.h"
24#include "mlkem_internal.h" 26#include "mlkem_internal.h"
25#include "mlkem_tests_util.h" 27#include "mlkem_tests_util.h"
28#include "sha3_internal.h"
26 29
27static int 30static int
28encode_private_key(const struct MLKEM768_private_key *priv, uint8_t **out_buf, 31encode_private_key(const struct MLKEM768_private_key *priv, uint8_t **out_buf,
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_keygen_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem768_keygen_tests.c
index 60c3983dea..b54b8c53ce 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_keygen_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_keygen_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_keygen_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static int 30static int
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_nist_decap_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem768_nist_decap_tests.c
index 248df7971f..0778c921b6 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_nist_decap_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_nist_decap_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_nist_decap_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static void 30static void
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem768_nist_keygen_tests.c b/src/regress/lib/libcrypto/mlkem/mlkem768_nist_keygen_tests.c
index 009bd30739..ee71aa2620 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem768_nist_keygen_tests.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem768_nist_keygen_tests.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem768_nist_keygen_tests.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,19 +13,18 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <stdint.h>
17#include <stdlib.h>
18#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20 23
21#include <openssl/evp.h> 24#include <openssl/bytestring.h>
25#include <openssl/mlkem.h>
22 26
23#include "bytestring.h"
24#include "mlkem.h"
25#include "mlkem_internal.h" 27#include "mlkem_internal.h"
26#include "sha3_internal.h"
27#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
28 29
29static int 30static int
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c
index ee73e19267..c4c13f0e7a 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem_tests_util.c,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,11 +13,13 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <err.h> 19#include <err.h>
17#include <stdlib.h> 20#include <stdint.h>
18#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h>
19#include <string.h> 23#include <string.h>
20 24
21#include "mlkem_tests_util.h" 25#include "mlkem_tests_util.h"
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.h b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.h
index 6666097577..934de44009 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.h
+++ b/src/regress/lib/libcrypto/mlkem/mlkem_tests_util.h
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Bob Beck <beck@obtuse.com> 1/* $OpenBSD: mlkem_tests_util.h,v 1.2 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
2 * 4 *
3 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
4 * 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
@@ -10,12 +12,18 @@
10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 15 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
14 17
15#ifndef MLKEM_TEST_UTIL_H 18#ifndef MLKEM_TEST_UTIL_H
16#define MLKEM_TEST_UTIL_H 19#define MLKEM_TEST_UTIL_H
17 20
18#include "bytestring.h" 21#include <stdint.h>
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25
26#include <openssl/bytestring.h>
19 27
20#define TEST(cond, msg) do { \ 28#define TEST(cond, msg) do { \
21 if ((cond)) { \ 29 if ((cond)) { \
diff --git a/src/regress/lib/libcrypto/mlkem/mlkem_unittest.c b/src/regress/lib/libcrypto/mlkem/mlkem_unittest.c
index 14832f1b41..b8779135e5 100644
--- a/src/regress/lib/libcrypto/mlkem/mlkem_unittest.c
+++ b/src/regress/lib/libcrypto/mlkem/mlkem_unittest.c
@@ -1,4 +1,6 @@
1/* Copyright (c) 2024, Google Inc. 1/* $OpenBSD: mlkem_unittest.c,v 1.3 2024/12/14 19:16:24 tb Exp $ */
2/*
3 * Copyright (c) 2024, Google Inc.
2 * Copyright (c) 2024, Bob Beck <beck@obtuse.com> 4 * Copyright (c) 2024, Bob Beck <beck@obtuse.com>
3 * 5 *
4 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
@@ -11,14 +13,17 @@
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
15 18
16#include <stdlib.h> 19#include <stdint.h>
17#include <stdio.h> 20#include <stdio.h>
21#include <stdlib.h>
18#include <string.h> 22#include <string.h>
19 23
20#include "bytestring.h" 24#include <openssl/bytestring.h>
21#include "mlkem.h" 25#include <openssl/mlkem.h>
26
22#include "mlkem_internal.h" 27#include "mlkem_internal.h"
23#include "mlkem_tests_util.h" 28#include "mlkem_tests_util.h"
24 29