From 193f645f65ad4ffdec3186e4176b23af10861199 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 13 Feb 2017 07:56:33 +0300 Subject: libs: libaxolotl: updated libaxolotl (libsignal-c) from (https://github.com/WhisperSystems/libsignal-protocol-c) --- .../src/curve25519/ed25519/additions/fe_isequal.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 libs/libaxolotl/src/curve25519/ed25519/additions/fe_isequal.c (limited to 'libs/libaxolotl/src/curve25519/ed25519/additions/fe_isequal.c') diff --git a/libs/libaxolotl/src/curve25519/ed25519/additions/fe_isequal.c b/libs/libaxolotl/src/curve25519/ed25519/additions/fe_isequal.c new file mode 100644 index 0000000000..67c5d33c96 --- /dev/null +++ b/libs/libaxolotl/src/curve25519/ed25519/additions/fe_isequal.c @@ -0,0 +1,14 @@ +#include "fe.h" +#include "crypto_verify_32.h" + +/* +return 1 if f == g +return 0 if f != g +*/ + +int fe_isequal(const fe f, const fe g) +{ + fe h; + fe_sub(h, f, g); + return 1 ^ (1 & (fe_isnonzero(h) >> 8)); +} -- cgit v1.2.3