| 1 |
|
| 2 |
#ifndef __CRYPTO_ADDITIONS__ |
| 3 |
#define __CRYPTO_ADDITIONS__ |
| 4 |
|
| 5 |
#include "crypto_uint32.h" |
| 6 |
#include "fe.h" |
| 7 |
#include "ge.h" |
| 8 |
|
| 9 |
#define MAX_MSG_LEN 256 |
| 10 |
|
| 11 |
void sc_neg(unsigned char *b, const unsigned char *a); |
| 12 |
void sc_cmov(unsigned char* f, const unsigned char* g, unsigned char b); |
| 13 |
|
| 14 |
int fe_isequal(const fe f, const fe g); |
| 15 |
int fe_isreduced(const unsigned char* s); |
| 16 |
void fe_mont_rhs(fe v2, const fe u); |
| 17 |
void fe_montx_to_edy(fe y, const fe u); |
| 18 |
void fe_sqrt(fe b, const fe a); |
| 19 |
|
| 20 |
int ge_isneutral(const ge_p3* q); |
| 21 |
void ge_neg(ge_p3* r, const ge_p3 *p); |
| 22 |
void ge_montx_to_p3(ge_p3* p, const fe u, const unsigned char ed_sign_bit); |
| 23 |
void ge_p3_to_montx(fe u, const ge_p3 *p); |
| 24 |
void ge_scalarmult(ge_p3 *h, const unsigned char *a, const ge_p3 *A); |
| 25 |
void ge_scalarmult_cofactor(ge_p3 *q, const ge_p3 *p); |
| 26 |
|
| 27 |
void elligator(fe u, const fe r); |
| 28 |
void hash_to_point(ge_p3* p, const unsigned char* msg, const unsigned long in_len); |
| 29 |
|
| 30 |
int crypto_sign_modified( |
| 31 |
unsigned char *sm, |
| 32 |
const unsigned char *m,unsigned long long mlen, |
| 33 |
const unsigned char *sk, /* Curve/Ed25519 private key */ |
| 34 |
const unsigned char *pk, /* Ed25519 public key */ |
| 35 |
const unsigned char *random /* 64 bytes random to hash into nonce */ |
| 36 |
); |
| 37 |
|
| 38 |
int crypto_sign_open_modified( |
| 39 |
unsigned char *m, |
| 40 |
const unsigned char *sm,unsigned long long smlen, |
| 41 |
const unsigned char *pk |
| 42 |
); |
| 43 |
|
| 44 |
|
| 45 |
#endif |