MOTION  0.01
Framework for mixed-protocol multi-party computation
Namespaces | Macros | Functions
mycurve25519.cpp File Reference
#include "mycurve25519.h"
#include <cassert>
#include <cstdlib>
#include <cstring>
#include "mycurve25519_tables.h"
#include <openssl/rand.h>
#include "stdio.h"
Include dependency graph for mycurve25519.cpp:

Namespaces

 encrypto
 
 encrypto::motion
 
 encrypto::motion::curve25519
 

Macros

#define assert_fe(f)
 
#define assert_fe_loose(f)
 
#define assert_fe_frozen(f)
 

Functions

static uint64_t encrypto::motion::curve25519::load_3 (const uint8_t *in)
 
static uint64_t encrypto::motion::curve25519::load_4 (const uint8_t *in)
 
static uint8_t encrypto::motion::curve25519::addcarryx_u25 (uint8_t c, uint32_t a, uint32_t b, uint32_t *low)
 
static uint8_t encrypto::motion::curve25519::addcarryx_u26 (uint8_t c, uint32_t a, uint32_t b, uint32_t *low)
 
static uint8_t encrypto::motion::curve25519::subborrow_u25 (uint8_t c, uint32_t a, uint32_t b, uint32_t *low)
 
static uint8_t encrypto::motion::curve25519::subborrow_u26 (uint8_t c, uint32_t a, uint32_t b, uint32_t *low)
 
static uint32_t encrypto::motion::curve25519::cmovznz32 (uint32_t t, uint32_t z, uint32_t nz)
 
static void encrypto::motion::curve25519::fe_frombytes_impl (uint32_t h[10], const uint8_t *s)
 
static void encrypto::motion::curve25519::fe_frombytes (fe *h, const uint8_t *s)
 
static void encrypto::motion::curve25519::fe_freeze (uint32_t out[10], const uint32_t in1[10])
 
static void encrypto::motion::curve25519::fe_tobytes (uint8_t s[32], const fe *f)
 
static void encrypto::motion::curve25519::fe_0 (fe *h)
 
static void encrypto::motion::curve25519::fe_loose_0 (fe_loose *h)
 
static void encrypto::motion::curve25519::fe_1 (fe *h)
 
static void encrypto::motion::curve25519::fe_loose_1 (fe_loose *h)
 
static void encrypto::motion::curve25519::fe_add_impl (uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10])
 
static void encrypto::motion::curve25519::fe_add (fe_loose *h, const fe *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_sub_impl (uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10])
 
static void encrypto::motion::curve25519::fe_sub (fe_loose *h, const fe *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_carry_impl (uint32_t out[10], const uint32_t in1[10])
 
static void encrypto::motion::curve25519::fe_carry (fe *h, const fe_loose *f)
 
static void encrypto::motion::curve25519::fe_mul_impl (uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10])
 
static void encrypto::motion::curve25519::fe_mul_ltt (fe_loose *h, const fe *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_mul_llt (fe_loose *h, const fe_loose *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_mul_ttt (fe *h, const fe *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_mul_tlt (fe *h, const fe_loose *f, const fe *g)
 
static void encrypto::motion::curve25519::fe_mul_ttl (fe *h, const fe *f, const fe_loose *g)
 
static void encrypto::motion::curve25519::fe_mul_tll (fe *h, const fe_loose *f, const fe_loose *g)
 
static void encrypto::motion::curve25519::fe_sqr_impl (uint32_t out[10], const uint32_t in1[10])
 
static void encrypto::motion::curve25519::fe_sq_tl (fe *h, const fe_loose *f)
 
static void encrypto::motion::curve25519::fe_sq_tt (fe *h, const fe *f)
 
static void encrypto::motion::curve25519::fe_cswap (fe *f, fe *g, unsigned int b)
 
static void encrypto::motion::curve25519::fe_mul_121666_impl (uint32_t out[10], const uint32_t in1[10])
 
static void encrypto::motion::curve25519::fe_mul121666 (fe *h, const fe_loose *f)
 
static void encrypto::motion::curve25519::fe_neg_impl (uint32_t out[10], const uint32_t in2[10])
 
static void encrypto::motion::curve25519::fe_neg (fe_loose *h, const fe *f)
 
static void encrypto::motion::curve25519::fe_cmov (fe_loose *f, const fe_loose *g, unsigned b)
 
static void encrypto::motion::curve25519::fe_copy (fe *h, const fe *f)
 
static void encrypto::motion::curve25519::fe_copy_lt (fe_loose *h, const fe *f)
 
static void encrypto::motion::curve25519::fe_copy_ll (fe_loose *h, const fe_loose *f)
 
static void encrypto::motion::curve25519::fe_loose_invert (fe *out, const fe_loose *z)
 
static void encrypto::motion::curve25519::fe_invert (fe *out, const fe *z)
 
static int encrypto::motion::curve25519::fe_isnonzero (const fe_loose *f)
 
static int encrypto::motion::curve25519::fe_isnegative (const fe *f)
 
static void encrypto::motion::curve25519::fe_sq2_tt (fe *h, const fe *f)
 
static void encrypto::motion::curve25519::fe_pow22523 (fe *out, const fe *z)
 
void encrypto::motion::curve25519::x25519_ge_tobytes (uint8_t s[32], const ge_p2 *h)
 
void encrypto::motion::curve25519::ge_p3_tobytes (uint8_t s[32], const ge_p3 *h)
 
int encrypto::motion::curve25519::x25519_ge_frombytes_vartime (ge_p3 *h, const uint8_t *s)
 
void encrypto::motion::curve25519::ge_p2_0 (ge_p2 *h)
 
void encrypto::motion::curve25519::ge_p3_0 (ge_p3 *h)
 
void encrypto::motion::curve25519::ge_cached_0 (ge_cached *h)
 
void encrypto::motion::curve25519::ge_precomp_0 (ge_precomp *h)
 
static void encrypto::motion::curve25519::ge_p3_to_p2 (ge_p2 *r, const ge_p3 *p)
 
void encrypto::motion::curve25519::x25519_ge_p3_to_cached (ge_cached *r, const ge_p3 *p)
 
void encrypto::motion::curve25519::x25519_ge_p1p1_to_p2 (ge_p2 *r, const ge_p1p1 *p)
 
void encrypto::motion::curve25519::x25519_ge_p1p1_to_p3 (ge_p3 *r, const ge_p1p1 *p)
 
static void encrypto::motion::curve25519::ge_p1p1_to_cached (ge_cached *r, const ge_p1p1 *p)
 
static void encrypto::motion::curve25519::ge_p2_dbl (ge_p1p1 *r, const ge_p2 *p)
 
static void encrypto::motion::curve25519::ge_p3_dbl (ge_p1p1 *r, const ge_p3 *p)
 
static void encrypto::motion::curve25519::ge_madd (ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q)
 
static void encrypto::motion::curve25519::ge_msub (ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q)
 
void encrypto::motion::curve25519::x25519_ge_add (ge_p1p1 *r, const ge_p3 *p, const ge_cached *q)
 
void encrypto::motion::curve25519::x25519_ge_sub (ge_p1p1 *r, const ge_p3 *p, const ge_cached *q)
 
static uint8_t encrypto::motion::curve25519::equal (signed char b, signed char c)
 
static void encrypto::motion::curve25519::cmov (ge_precomp *t, const ge_precomp *u, uint8_t b)
 
void encrypto::motion::curve25519::x25519_ge_scalarmult_small_precomp (ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 *2 *32])
 
static uint8_t encrypto::motion::curve25519::negative (signed char b)
 
static void encrypto::motion::curve25519::table_select (ge_precomp *t, int pos, signed char b)
 
void encrypto::motion::curve25519::x25519_ge_scalarmult_base (ge_p3 *h, const uint8_t *a)
 
static void encrypto::motion::curve25519::cmov_cached (ge_cached *t, ge_cached *u, uint8_t b)
 
void encrypto::motion::curve25519::x25519_ge_scalarmult (ge_p2 *r, const uint8_t *scalar, const ge_p3 *A)
 
static void encrypto::motion::curve25519::slide (signed char *r, const uint8_t *a)
 
void encrypto::motion::curve25519::ge_double_scalarmult_vartime (ge_p2 *r, const uint8_t *a, const ge_p3 *A, const uint8_t *b)
 
void encrypto::motion::curve25519::x25519_sc_reduce (uint8_t s[64])
 
static void encrypto::motion::curve25519::sc_muladd (uint8_t *s, const uint8_t *a, const uint8_t *b, const uint8_t *c)
 
static void encrypto::motion::curve25519::x25519_scalar_mult_generic (uint8_t out[32], const uint8_t scalar[32], const uint8_t point[32])
 
static void encrypto::motion::curve25519::x25519_scalar_mult (uint8_t out[32], const uint8_t scalar[32], const uint8_t point[32])
 
void encrypto::motion::curve25519::RandomBytes (void *buf, size_t nbytes)
 
void encrypto::motion::curve25519::sc_random (uint8_t s[32])
 
void encrypto::motion::curve25519::x25519_ge_p2_to_p3 (ge_p3 *r, const ge_p2 *p)
 

Macro Definition Documentation

◆ assert_fe

#define assert_fe (   f)
Value:
do { \
for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \
assert(f[_assert_fe_i] < 1.125 * (1 << (26 - (_assert_fe_i & 1)))); \
} \
} while (0)

◆ assert_fe_frozen

#define assert_fe_frozen (   f)
Value:
do { \
for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \
assert(f[_assert_fe_i] < (1u << (26 - (_assert_fe_i & 1)))); \
} \
} while (0)

◆ assert_fe_loose

#define assert_fe_loose (   f)
Value:
do { \
for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \
assert(f[_assert_fe_i] < 3.375 * (1 << (26 - (_assert_fe_i & 1)))); \
} \
} while (0)