summaryrefslogtreecommitdiff
path: root/test/default/scalarmult7.c
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-11-11 11:18:18 -0500
committerMicah Anderson <micah@riseup.net>2014-11-11 11:18:18 -0500
commitc73b6c9ba513fea3e18b696e659049df69931171 (patch)
treea001cd6acbecead76b9a55f324278e8d077fe3d5 /test/default/scalarmult7.c
parenteabdc6e3d62550679476899dd861c23b63937142 (diff)
update to 1.0.0-1 version of the package
Diffstat (limited to 'test/default/scalarmult7.c')
-rw-r--r--test/default/scalarmult7.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/default/scalarmult7.c b/test/default/scalarmult7.c
new file mode 100644
index 0000000..e83493e
--- /dev/null
+++ b/test/default/scalarmult7.c
@@ -0,0 +1,31 @@
+
+#define TEST_NAME "scalarmult7"
+#include "cmptest.h"
+
+unsigned char p1[32] = {
+ 0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
+ 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
+ 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
+ 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea
+};
+
+unsigned char p2[32] = {
+ 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54,
+ 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a,
+ 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4,
+ 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a
+};
+
+unsigned char scalar[32];
+unsigned char out1[32];
+unsigned char out2[32];
+
+int main(void)
+{
+ scalar[0] = 1U;
+ crypto_scalarmult_curve25519(out1, scalar, p1);
+ crypto_scalarmult_curve25519(out2, scalar, p2);
+ printf("%d\n", !!memcmp(out1, out2, 32));
+
+ return 0;
+}