diff options
author | tb <> | 2022-11-22 17:58:15 +0000 |
---|---|---|
committer | tb <> | 2022-11-22 17:58:15 +0000 |
commit | 4f5c422dea71b791ac8c782e12e8af5ab16c8048 (patch) | |
tree | 3bae15a5e7afd062f4e5c10454e6f2df4581e2ce /src/regress/lib | |
parent | 926be701be7f12a3ddf81fb80a8e65cdacb47e4b (diff) | |
download | openbsd-4f5c422dea71b791ac8c782e12e8af5ab16c8048.tar.gz openbsd-4f5c422dea71b791ac8c782e12e8af5ab16c8048.tar.bz2 openbsd-4f5c422dea71b791ac8c782e12e8af5ab16c8048.zip |
ed25519 test: make the testvectors table const
Diffstat (limited to 'src/regress/lib')
-rw-r--r-- | src/regress/lib/libcrypto/curve25519/ed25519test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/curve25519/ed25519test.c b/src/regress/lib/libcrypto/curve25519/ed25519test.c index da14070c2f..f20054cb71 100644 --- a/src/regress/lib/libcrypto/curve25519/ed25519test.c +++ b/src/regress/lib/libcrypto/curve25519/ed25519test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ed25519test.c,v 1.6 2022/11/17 22:45:48 tb Exp $ */ | 1 | /* $OpenBSD: ed25519test.c,v 1.7 2022/11/22 17:58:15 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019, 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2019, 2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
@@ -34,7 +34,7 @@ struct testvector { | |||
34 | * Test vectors from https://tools.ietf.org/html/rfc8032#section-7.1. | 34 | * Test vectors from https://tools.ietf.org/html/rfc8032#section-7.1. |
35 | * sec_key is the concatenation of SECRET KEY and PUBLIC KEY in that reference. | 35 | * sec_key is the concatenation of SECRET KEY and PUBLIC KEY in that reference. |
36 | */ | 36 | */ |
37 | struct testvector testvectors[] = { | 37 | static const struct testvector testvectors[] = { |
38 | { | 38 | { |
39 | .sec_key = { | 39 | .sec_key = { |
40 | 0x9d, 0x61, 0xb1, 0x9d, 0xef, 0xfd, 0x5a, 0x60, | 40 | 0x9d, 0x61, 0xb1, 0x9d, 0xef, 0xfd, 0x5a, 0x60, |
@@ -319,7 +319,7 @@ test_ED25519_verify(void) | |||
319 | int failed = 0; | 319 | int failed = 0; |
320 | 320 | ||
321 | for (i = 0; i < num_testvectors; i++) { | 321 | for (i = 0; i < num_testvectors; i++) { |
322 | struct testvector *tc = &testvectors[i]; | 322 | const struct testvector *tc = &testvectors[i]; |
323 | 323 | ||
324 | if (!ED25519_verify(tc->message, tc->message_len, tc->signature, | 324 | if (!ED25519_verify(tc->message, tc->message_len, tc->signature, |
325 | tc->pub_key)) { | 325 | tc->pub_key)) { |
@@ -338,7 +338,7 @@ test_ED25519_sign(void) | |||
338 | int failed = 0; | 338 | int failed = 0; |
339 | 339 | ||
340 | for (i = 0; i < num_testvectors; i++) { | 340 | for (i = 0; i < num_testvectors; i++) { |
341 | struct testvector *tc = &testvectors[i]; | 341 | const struct testvector *tc = &testvectors[i]; |
342 | uint8_t signature[64]; | 342 | uint8_t signature[64]; |
343 | 343 | ||
344 | if (!ED25519_sign(signature, tc->message, tc->message_len, | 344 | if (!ED25519_sign(signature, tc->message, tc->message_len, |