diff options
Diffstat (limited to 'nacl/tests/scalarmult6.c')
-rw-r--r-- | nacl/tests/scalarmult6.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nacl/tests/scalarmult6.c b/nacl/tests/scalarmult6.c new file mode 100644 index 00000000..89bf9bdd --- /dev/null +++ b/nacl/tests/scalarmult6.c | |||
@@ -0,0 +1,30 @@ | |||
1 | #include <stdio.h> | ||
2 | #include "crypto_scalarmult_curve25519.h" | ||
3 | |||
4 | unsigned char bobsk[32] = { | ||
5 | 0x5d,0xab,0x08,0x7e,0x62,0x4a,0x8a,0x4b | ||
6 | ,0x79,0xe1,0x7f,0x8b,0x83,0x80,0x0e,0xe6 | ||
7 | ,0x6f,0x3b,0xb1,0x29,0x26,0x18,0xb6,0xfd | ||
8 | ,0x1c,0x2f,0x8b,0x27,0xff,0x88,0xe0,0xeb | ||
9 | } ; | ||
10 | |||
11 | unsigned char alicepk[32] = { | ||
12 | 0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54 | ||
13 | ,0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a | ||
14 | ,0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4 | ||
15 | ,0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a | ||
16 | } ; | ||
17 | |||
18 | unsigned char k[32]; | ||
19 | |||
20 | main() | ||
21 | { | ||
22 | int i; | ||
23 | crypto_scalarmult_curve25519(k,bobsk,alicepk); | ||
24 | for (i = 0;i < 32;++i) { | ||
25 | if (i > 0) printf(","); else printf(" "); | ||
26 | printf("0x%02x",(unsigned int) k[i]); | ||
27 | if (i % 8 == 7) printf("\n"); | ||
28 | } | ||
29 | return 0; | ||
30 | } | ||