diff options
| author | jsing <> | 2022-11-09 17:49:54 +0000 |
|---|---|---|
| committer | jsing <> | 2022-11-09 17:49:54 +0000 |
| commit | 681e69a54fb1a2c3a89f57e6dfff1d482143b548 (patch) | |
| tree | 634c217905e0703e68e90d23b60688120aca517e | |
| parent | ce63bfbe542f710d82181ab0975b822aaf517973 (diff) | |
| download | openbsd-681e69a54fb1a2c3a89f57e6dfff1d482143b548.tar.gz openbsd-681e69a54fb1a2c3a89f57e6dfff1d482143b548.tar.bz2 openbsd-681e69a54fb1a2c3a89f57e6dfff1d482143b548.zip | |
Revise ED25519 regress following API changes.
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libcrypto/curve25519/ed25519test.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/regress/lib/libcrypto/curve25519/ed25519test.c b/src/regress/lib/libcrypto/curve25519/ed25519test.c index d7c0ff45c6..1ad070ae3b 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.2 2022/11/07 12:36:21 tb Exp $ */ | 1 | /* $OpenBSD: ed25519test.c,v 1.3 2022/11/09 17:49:54 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -22,9 +22,9 @@ | |||
| 22 | #include <openssl/curve25519.h> | 22 | #include <openssl/curve25519.h> |
| 23 | 23 | ||
| 24 | struct testvector { | 24 | struct testvector { |
| 25 | const uint8_t sec_key[ED25519_PRIVATE_KEY_LEN]; | 25 | const uint8_t sec_key[ED25519_PRIVATE_KEY_LENGTH]; |
| 26 | const uint8_t pub_key[ED25519_PUBLIC_KEY_LEN]; | 26 | const uint8_t pub_key[ED25519_PUBLIC_KEY_LENGTH]; |
| 27 | const uint8_t signature[ED25519_SIGNATURE_LEN]; | 27 | const uint8_t signature[ED25519_SIGNATURE_LENGTH]; |
| 28 | size_t message_len; | 28 | size_t message_len; |
| 29 | const uint8_t *message; | 29 | const uint8_t *message; |
| 30 | }; | 30 | }; |
| @@ -40,10 +40,6 @@ struct testvector testvectors[] = { | |||
| 40 | 0xba, 0x84, 0x4a, 0xf4, 0x92, 0xec, 0x2c, 0xc4, | 40 | 0xba, 0x84, 0x4a, 0xf4, 0x92, 0xec, 0x2c, 0xc4, |
| 41 | 0x44, 0x49, 0xc5, 0x69, 0x7b, 0x32, 0x69, 0x19, | 41 | 0x44, 0x49, 0xc5, 0x69, 0x7b, 0x32, 0x69, 0x19, |
| 42 | 0x70, 0x3b, 0xac, 0x03, 0x1c, 0xae, 0x7f, 0x60, | 42 | 0x70, 0x3b, 0xac, 0x03, 0x1c, 0xae, 0x7f, 0x60, |
| 43 | 0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, | ||
| 44 | 0xd5, 0x4b, 0xfe, 0xd3, 0xc9, 0x64, 0x07, 0x3a, | ||
| 45 | 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, 0x23, 0x25, | ||
| 46 | 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a, | ||
| 47 | }, | 43 | }, |
| 48 | .pub_key = { | 44 | .pub_key = { |
| 49 | 0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, | 45 | 0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, |
| @@ -70,10 +66,6 @@ struct testvector testvectors[] = { | |||
| 70 | 0x9d, 0xb6, 0xc3, 0x46, 0xec, 0x11, 0x4e, 0x0f, | 66 | 0x9d, 0xb6, 0xc3, 0x46, 0xec, 0x11, 0x4e, 0x0f, |
| 71 | 0x5b, 0x8a, 0x31, 0x9f, 0x35, 0xab, 0xa6, 0x24, | 67 | 0x5b, 0x8a, 0x31, 0x9f, 0x35, 0xab, 0xa6, 0x24, |
| 72 | 0xda, 0x8c, 0xf6, 0xed, 0x4f, 0xb8, 0xa6, 0xfb, | 68 | 0xda, 0x8c, 0xf6, 0xed, 0x4f, 0xb8, 0xa6, 0xfb, |
| 73 | 0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, | ||
| 74 | 0x92, 0xb7, 0x0a, 0xa7, 0x4d, 0x1b, 0x7e, 0xbc, | ||
| 75 | 0x9c, 0x98, 0x2c, 0xcf, 0x2e, 0xc4, 0x96, 0x8c, | ||
| 76 | 0xc0, 0xcd, 0x55, 0xf1, 0x2a, 0xf4, 0x66, 0x0c, | ||
| 77 | }, | 69 | }, |
| 78 | .pub_key = { | 70 | .pub_key = { |
| 79 | 0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, | 71 | 0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, |
| @@ -100,10 +92,6 @@ struct testvector testvectors[] = { | |||
| 100 | 0xed, 0xb7, 0x44, 0x2f, 0x31, 0xdc, 0xb7, 0xb1, | 92 | 0xed, 0xb7, 0x44, 0x2f, 0x31, 0xdc, 0xb7, 0xb1, |
| 101 | 0x66, 0xd3, 0x85, 0x35, 0x07, 0x6f, 0x09, 0x4b, | 93 | 0x66, 0xd3, 0x85, 0x35, 0x07, 0x6f, 0x09, 0x4b, |
| 102 | 0x85, 0xce, 0x3a, 0x2e, 0x0b, 0x44, 0x58, 0xf7, | 94 | 0x85, 0xce, 0x3a, 0x2e, 0x0b, 0x44, 0x58, 0xf7, |
| 103 | 0xfc, 0x51, 0xcd, 0x8e, 0x62, 0x18, 0xa1, 0xa3, | ||
| 104 | 0x8d, 0xa4, 0x7e, 0xd0, 0x02, 0x30, 0xf0, 0x58, | ||
| 105 | 0x08, 0x16, 0xed, 0x13, 0xba, 0x33, 0x03, 0xac, | ||
| 106 | 0x5d, 0xeb, 0x91, 0x15, 0x48, 0x90, 0x80, 0x25, | ||
| 107 | }, | 95 | }, |
| 108 | .pub_key = { | 96 | .pub_key = { |
| 109 | 0xfc, 0x51, 0xcd, 0x8e, 0x62, 0x18, 0xa1, 0xa3, | 97 | 0xfc, 0x51, 0xcd, 0x8e, 0x62, 0x18, 0xa1, 0xa3, |
| @@ -130,10 +118,6 @@ struct testvector testvectors[] = { | |||
| 130 | 0x17, 0x63, 0x0f, 0x22, 0x68, 0x76, 0xb8, 0x6c, | 118 | 0x17, 0x63, 0x0f, 0x22, 0x68, 0x76, 0xb8, 0x6c, |
| 131 | 0x81, 0x60, 0xcc, 0x58, 0x3b, 0xc0, 0x13, 0x74, | 119 | 0x81, 0x60, 0xcc, 0x58, 0x3b, 0xc0, 0x13, 0x74, |
| 132 | 0x4c, 0x6b, 0xf2, 0x55, 0xf5, 0xcc, 0x0e, 0xe5, | 120 | 0x4c, 0x6b, 0xf2, 0x55, 0xf5, 0xcc, 0x0e, 0xe5, |
| 133 | 0x27, 0x81, 0x17, 0xfc, 0x14, 0x4c, 0x72, 0x34, | ||
| 134 | 0x0f, 0x67, 0xd0, 0xf2, 0x31, 0x6e, 0x83, 0x86, | ||
| 135 | 0xce, 0xff, 0xbf, 0x2b, 0x24, 0x28, 0xc9, 0xc5, | ||
| 136 | 0x1f, 0xef, 0x7c, 0x59, 0x7f, 0x1d, 0x42, 0x6e, | ||
| 137 | }, | 121 | }, |
| 138 | .pub_key = { | 122 | .pub_key = { |
| 139 | 0x27, 0x81, 0x17, 0xfc, 0x14, 0x4c, 0x72, 0x34, | 123 | 0x27, 0x81, 0x17, 0xfc, 0x14, 0x4c, 0x72, 0x34, |
| @@ -289,10 +273,6 @@ struct testvector testvectors[] = { | |||
| 289 | 0x62, 0xec, 0x77, 0x58, 0x75, 0x20, 0x91, 0x1e, | 273 | 0x62, 0xec, 0x77, 0x58, 0x75, 0x20, 0x91, 0x1e, |
| 290 | 0x9a, 0x75, 0x9c, 0xec, 0x1d, 0x19, 0x75, 0x5b, | 274 | 0x9a, 0x75, 0x9c, 0xec, 0x1d, 0x19, 0x75, 0x5b, |
| 291 | 0x7d, 0xa9, 0x01, 0xb9, 0x6d, 0xca, 0x3d, 0x42, | 275 | 0x7d, 0xa9, 0x01, 0xb9, 0x6d, 0xca, 0x3d, 0x42, |
| 292 | 0xec, 0x17, 0x2b, 0x93, 0xad, 0x5e, 0x56, 0x3b, | ||
| 293 | 0xf4, 0x93, 0x2c, 0x70, 0xe1, 0x24, 0x50, 0x34, | ||
| 294 | 0xc3, 0x54, 0x67, 0xef, 0x2e, 0xfd, 0x4d, 0x64, | ||
| 295 | 0xeb, 0xf8, 0x19, 0x68, 0x34, 0x67, 0xe2, 0xbf, | ||
| 296 | }, | 276 | }, |
| 297 | .pub_key = { | 277 | .pub_key = { |
| 298 | 0xec, 0x17, 0x2b, 0x93, 0xad, 0x5e, 0x56, 0x3b, | 278 | 0xec, 0x17, 0x2b, 0x93, 0xad, 0x5e, 0x56, 0x3b, |
| @@ -359,7 +339,7 @@ test_ED25519_sign(void) | |||
| 359 | uint8_t signature[64]; | 339 | uint8_t signature[64]; |
| 360 | 340 | ||
| 361 | if (!ED25519_sign(signature, tc->message, tc->message_len, | 341 | if (!ED25519_sign(signature, tc->message, tc->message_len, |
| 362 | tc->sec_key)) { | 342 | tc->pub_key, tc->sec_key)) { |
| 363 | warnx("failed signature in test case %zu", i); | 343 | warnx("failed signature in test case %zu", i); |
| 364 | failed = 1; | 344 | failed = 1; |
| 365 | } | 345 | } |
