summaryrefslogtreecommitdiff
path: root/libs/libaxolotl/src/curve25519/ed25519/additions/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libaxolotl/src/curve25519/ed25519/additions/utility.c')
-rw-r--r--libs/libaxolotl/src/curve25519/ed25519/additions/utility.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/libaxolotl/src/curve25519/ed25519/additions/utility.c b/libs/libaxolotl/src/curve25519/ed25519/additions/utility.c
new file mode 100644
index 0000000000..c59099a9e3
--- /dev/null
+++ b/libs/libaxolotl/src/curve25519/ed25519/additions/utility.c
@@ -0,0 +1,29 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include "utility.h"
+
+void print_vector(const char* name, const unsigned char* v)
+{
+ int count;
+ printf("%s = \n", name);
+ for (count = 0; count < 32; count++)
+ printf("%02x ", v[count]);
+ printf("\n");
+}
+
+void print_bytes(const char* name, const unsigned char* v, int numbytes)
+{
+ int count;
+ printf("%s = \n", name);
+ for (count = 0; count < numbytes; count++)
+ printf("%02x ", v[count]);
+ printf("\n");
+}
+
+void print_fe(const char* name, const fe in)
+{
+ unsigned char bytes[32];
+ fe_tobytes(bytes, in);
+ print_vector(name, bytes);
+}
+