summaryrefslogtreecommitdiff
path: root/ext/ed25519-amd64-asm/fe25519.h
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2018-04-25 06:39:02 -0700
committerGitHub <noreply@github.com>2018-04-25 06:39:02 -0700
commit42ec780a6f6eedef4d8b1d8218bd72fc6ed75cc0 (patch)
tree7bf86c4d92d6a0f77eced79bfc33313c62c7b6dd /ext/ed25519-amd64-asm/fe25519.h
parent18c9dc8a0649c866eff9f299f20fa5b19c502e52 (diff)
parent4608880fb06700822d01e9e5d6729fcdeb82b64b (diff)
downloadinfinitytier-42ec780a6f6eedef4d8b1d8218bd72fc6ed75cc0.tar.gz
infinitytier-42ec780a6f6eedef4d8b1d8218bd72fc6ed75cc0.zip
Merge branch 'dev' into netbsd-support
Diffstat (limited to 'ext/ed25519-amd64-asm/fe25519.h')
-rw-r--r--ext/ed25519-amd64-asm/fe25519.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/ext/ed25519-amd64-asm/fe25519.h b/ext/ed25519-amd64-asm/fe25519.h
new file mode 100644
index 00000000..33ffabbe
--- /dev/null
+++ b/ext/ed25519-amd64-asm/fe25519.h
@@ -0,0 +1,64 @@
+#ifndef FE25519_H
+#define FE25519_H
+
+#define fe25519 crypto_sign_ed25519_amd64_64_fe25519
+#define fe25519_freeze crypto_sign_ed25519_amd64_64_fe25519_freeze
+#define fe25519_unpack crypto_sign_ed25519_amd64_64_fe25519_unpack
+#define fe25519_pack crypto_sign_ed25519_amd64_64_fe25519_pack
+#define fe25519_iszero_vartime crypto_sign_ed25519_amd64_64_fe25519_iszero_vartime
+#define fe25519_iseq_vartime crypto_sign_ed25519_amd64_64_fe25519_iseq_vartime
+#define fe25519_cmov crypto_sign_ed25519_amd64_64_fe25519_cmov
+#define fe25519_setint crypto_sign_ed25519_amd64_64_fe25519_setint
+#define fe25519_neg crypto_sign_ed25519_amd64_64_fe25519_neg
+#define fe25519_getparity crypto_sign_ed25519_amd64_64_fe25519_getparity
+#define fe25519_add crypto_sign_ed25519_amd64_64_fe25519_add
+#define fe25519_sub crypto_sign_ed25519_amd64_64_fe25519_sub
+#define fe25519_mul crypto_sign_ed25519_amd64_64_fe25519_mul
+#define fe25519_mul121666 crypto_sign_ed25519_amd64_64_fe25519_mul121666
+#define fe25519_square crypto_sign_ed25519_amd64_64_fe25519_square
+#define fe25519_invert crypto_sign_ed25519_amd64_64_fe25519_invert
+#define fe25519_pow2523 crypto_sign_ed25519_amd64_64_fe25519_pow2523
+
+typedef struct
+{
+ unsigned long long v[4];
+}
+fe25519;
+
+void fe25519_freeze(fe25519 *r);
+
+void fe25519_unpack(fe25519 *r, const unsigned char x[32]);
+
+void fe25519_pack(unsigned char r[32], const fe25519 *x);
+
+void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b);
+
+void fe25519_cswap(fe25519 *r, fe25519 *x, unsigned char b);
+
+void fe25519_setint(fe25519 *r, unsigned int v);
+
+void fe25519_neg(fe25519 *r, const fe25519 *x);
+
+unsigned char fe25519_getparity(const fe25519 *x);
+
+int fe25519_iszero_vartime(const fe25519 *x);
+
+int fe25519_iseq_vartime(const fe25519 *x, const fe25519 *y);
+
+void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y);
+
+void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y);
+
+void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y);
+
+void fe25519_mul121666(fe25519 *r, const fe25519 *x);
+
+void fe25519_square(fe25519 *r, const fe25519 *x);
+
+void fe25519_pow(fe25519 *r, const fe25519 *x, const unsigned char *e);
+
+void fe25519_invert(fe25519 *r, const fe25519 *x);
+
+void fe25519_pow2523(fe25519 *r, const fe25519 *x);
+
+#endif