| 1 |
#ifndef __ED448_H |
| 2 |
#define __ED448_H |
| 3 |
|
| 4 |
#include "common.h" |
| 5 |
#include "mont.h" |
| 6 |
|
| 7 |
typedef struct _WorkplaceEd448 { |
| 8 |
uint64_t *a, *b, *c, *d, *e, *f; |
| 9 |
uint64_t *scratch; |
| 10 |
} WorkplaceEd448; |
| 11 |
|
| 12 |
typedef struct _EcContext { |
| 13 |
MontContext *mont_ctx; |
| 14 |
uint64_t *d; |
| 15 |
} EcContext; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
typedef struct _PointEd448 { |
| 21 |
const EcContext *ec_ctx; |
| 22 |
WorkplaceEd448 *wp; |
| 23 |
uint64_t *x; |
| 24 |
uint64_t *y; |
| 25 |
uint64_t *z; |
| 26 |
} PointEd448; |
| 27 |
|
| 28 |
EXPORT_SYM int ed448_new_context(EcContext **pec_ctx); |
| 29 |
EXPORT_SYM void ed448_free_context(EcContext *ec_ctx); |
| 30 |
EXPORT_SYM int ed448_new_point(PointEd448 **pecp, |
| 31 |
const uint8_t *x, |
| 32 |
const uint8_t *y, |
| 33 |
size_t len, |
| 34 |
const EcContext *ec_ctx); |
| 35 |
EXPORT_SYM int ed448_clone(PointEd448 **pecp2, const PointEd448 *ecp); |
| 36 |
EXPORT_SYM int ed448_copy(PointEd448 *ecp1, const PointEd448 *ecp2); |
| 37 |
EXPORT_SYM void ed448_free_point(PointEd448 *ecp); |
| 38 |
EXPORT_SYM int ed448_get_xy(uint8_t *x, uint8_t *y, size_t len, const PointEd448 *ecp); |
| 39 |
EXPORT_SYM int ed448_add(PointEd448 *ecpa, const PointEd448 *ecpb); |
| 40 |
EXPORT_SYM int ed448_double(PointEd448 *P); |
| 41 |
EXPORT_SYM int ed448_scalar(PointEd448 *P, const uint8_t *scalar, size_t scalar_len, uint64_t); |
| 42 |
EXPORT_SYM int ed448_cmp(const PointEd448 *ecp1, const PointEd448 *ecp2); |
| 43 |
EXPORT_SYM int ed448_neg(PointEd448 *P); |
| 44 |
#endif |