libsodium: updated to 1.0.10
[tomato.git] / release / src / router / libsodium / test / default / scalarmult7.c
blob8e1770cd232bb1de10d07b0a587890fa0f4c6498
2 #define TEST_NAME "scalarmult7"
3 #include "cmptest.h"
5 static unsigned char p1[32] = {
6 0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
7 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
8 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
9 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea
12 static unsigned char p2[32] = {
13 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
14 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
15 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
16 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a
19 static unsigned char scalar[32];
20 static unsigned char out1[32];
21 static unsigned char out2[32];
23 int main(void)
25 int ret;
27 scalar[0] = 1U;
28 ret = crypto_scalarmult_curve25519(out1, scalar, p1);
29 assert(ret == 0);
30 ret = crypto_scalarmult_curve25519(out2, scalar, p2);
31 assert(ret == 0);
32 printf("%d\n", !!memcmp(out1, out2, 32));
34 return 0;