xref: /freebsd/crypto/libecc/src/tests/ed25519ph_test_vectors.h (revision dd21556857e8d40f66bf5ad54754d9d52669ebf7)
1 /*
2  *  Copyright (C) 2021 - This file is part of libecc project
3  *
4  *  Authors:
5  *      Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
6  *      Ryad BENADJILA <ryadbenadjila@gmail.com>
7  *
8  *  This software is licensed under a dual BSD and GPL v2 license.
9  *  See LICENSE file at the root folder of the project.
10  */
11 #ifndef __ED25519PH_TEST_VECTORS_H__
12 #define __ED25519PH_TEST_VECTORS_H__
13 
14 /************************************************/
15 static const u8 ed25519ph_1_test_vectors_priv_key[] = {
16 	0x83, 0x3f, 0xe6, 0x24, 0x09, 0x23, 0x7b, 0x9d, 0x62, 0xec, 0x77, 0x58, 0x75, 0x20, 0x91, 0x1e, 0x9a, 0x75, 0x9c, 0xec, 0x1d, 0x19, 0x75, 0x5b, 0x7d, 0xa9, 0x01, 0xb9, 0x6d, 0xca, 0x3d, 0x42,
17 };
18 static const u8 ed25519ph_1_test_vectors_message[] = {
19 	0x61, 0x62, 0x63,
20 };
21 static const u8 ed25519ph_1_test_vectors_expected_sig[] = {
22 	0x98, 0xa7, 0x02, 0x22, 0xf0, 0xb8, 0x12, 0x1a, 0xa9, 0xd3, 0x0f, 0x81, 0x3d, 0x68, 0x3f, 0x80, 0x9e, 0x46, 0x2b, 0x46, 0x9c, 0x7f, 0xf8, 0x76, 0x39, 0x49, 0x9b, 0xb9, 0x4e, 0x6d, 0xae, 0x41, 0x31, 0xf8, 0x50, 0x42, 0x46, 0x3c, 0x2a, 0x35, 0x5a, 0x20, 0x03, 0xd0, 0x62, 0xad, 0xf5, 0xaa, 0xa1, 0x0b, 0x8c, 0x61, 0xe6, 0x36, 0x06, 0x2a, 0xaa, 0xd1, 0x1c, 0x2a, 0x26, 0x08, 0x34, 0x06,
23 };
24 static const ec_test_case ed25519ph_1_test_case = {
25 	.name = "EDDSA25519PH-SHA512/wei25519 1",
26 	.ec_str_p = &wei25519_str_params,
27 	.priv_key = ed25519ph_1_test_vectors_priv_key,
28 	.priv_key_len = sizeof(ed25519ph_1_test_vectors_priv_key),
29 	.nn_random = NULL,
30 	.hash_type = SHA512,
31 	.msg = (const char *)ed25519ph_1_test_vectors_message,
32 	.msglen = sizeof(ed25519ph_1_test_vectors_message),
33 	.sig_type = EDDSA25519PH,
34 	.exp_sig = ed25519ph_1_test_vectors_expected_sig,
35 	.exp_siglen = sizeof(ed25519ph_1_test_vectors_expected_sig),
36 	.adata = NULL,
37 	.adata_len = 0
38 };
39 
40 /************************************************/
41 #define EDDSA25519PH_SHA512_WEI25519_ALL_TESTS() \
42 	&ed25519ph_1_test_case,
43 
44 #endif /* __ED25519PH_TEST_VECTORS_H__ */
45 
46