summaryrefslogtreecommitdiff
path: root/ext/ed25519-amd64-asm/fe25519_getparity.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ed25519-amd64-asm/fe25519_getparity.c')
-rw-r--r--ext/ed25519-amd64-asm/fe25519_getparity.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/ed25519-amd64-asm/fe25519_getparity.c b/ext/ed25519-amd64-asm/fe25519_getparity.c
new file mode 100644
index 00000000..a003ec8f
--- /dev/null
+++ b/ext/ed25519-amd64-asm/fe25519_getparity.c
@@ -0,0 +1,8 @@
+#include "fe25519.h"
+
+unsigned char fe25519_getparity(const fe25519 *x)
+{
+ fe25519 t = *x;
+ fe25519_freeze(&t);
+ return (unsigned char)t.v[0] & 1;
+}