1*f447f37aSriastradh
2*f447f37aSriastradh #define TEST_NAME "scalarmult7"
3*f447f37aSriastradh #include "cmptest.h"
4*f447f37aSriastradh
5*f447f37aSriastradh static unsigned char p1[32] = {
6*f447f37aSriastradh 0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d,
7*f447f37aSriastradh 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38,
8*f447f37aSriastradh 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea
9*f447f37aSriastradh };
10*f447f37aSriastradh
11*f447f37aSriastradh static unsigned char p2[32] = {
12*f447f37aSriastradh 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d,
13*f447f37aSriastradh 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38,
14*f447f37aSriastradh 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a
15*f447f37aSriastradh };
16*f447f37aSriastradh
17*f447f37aSriastradh static unsigned char scalar[32];
18*f447f37aSriastradh static unsigned char out1[32];
19*f447f37aSriastradh static unsigned char out2[32];
20*f447f37aSriastradh
21*f447f37aSriastradh int
main(void)22*f447f37aSriastradh main(void)
23*f447f37aSriastradh {
24*f447f37aSriastradh int ret;
25*f447f37aSriastradh
26*f447f37aSriastradh scalar[0] = 1U;
27*f447f37aSriastradh ret = crypto_scalarmult_curve25519(out1, scalar, p1);
28*f447f37aSriastradh assert(ret == 0);
29*f447f37aSriastradh ret = crypto_scalarmult_curve25519(out2, scalar, p2);
30*f447f37aSriastradh assert(ret == 0);
31*f447f37aSriastradh printf("%d\n", !!memcmp(out1, out2, 32));
32*f447f37aSriastradh
33*f447f37aSriastradh return 0;
34*f447f37aSriastradh }
35