#ifndef SC25519_HEADER_
#define SC25519_HEADER_
#include "../include/bigint.h"
typedef UN_256bitValue sc25519;
void
sc25519_to32bytes(
uint8_t r[32],
const sc25519* x
);
void
sc25519_from64bytes(
sc25519* r,
const uint8_t x[64]
);
void
sc25519_from32bytes(
sc25519* r,
const uint8_t x[32]
);
#define SC25519_WINDOW4_SIZE (64)
#define SC25519_INITIALIZER_FOR_ONE_HALF { \
0xf7, 0xe9, 0x7a, 0x2e, 0x8d, 0x31, 0x09, 0x2c,\
0x6b, 0xce, 0x7b, 0x51, 0xef, 0x7c, 0x6f, 0x0a,\
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 }
void
sc25519_window4(
signed char r[SC25519_WINDOW4_SIZE],
const sc25519* s
);
void
sc25519_2interleave1(
uint8_t r[255],
const sc25519* s1,
const sc25519* s2
);
void
sc25519_add(
sc25519* result,
const sc25519* addend1,
const sc25519* addend2
);
void
sc25519_sub(
sc25519* result,
const sc25519* addend,
const sc25519* valueToSubstract
);
void
sc25519_mul(
sc25519* r,
const sc25519* x,
const sc25519* y
);
void
sc25519_sqr(
sc25519* r,
const sc25519* x
);
void
sc25519_reduce(UN_512bitValue* valueToReduce);
void sc25519_invert(sc25519 *result, const sc25519* in);
void sc25519_inverse(UN_256bitValue *R, const UN_256bitValue *X);
void sc25519_binary_extended_gcd(UN_256bitValue *R, const UN_256bitValue *X, const UN_256bitValue *Y);
#endif