| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| |
|
| | #ifndef NETTLE_ECC_H_INCLUDED |
| | #define NETTLE_ECC_H_INCLUDED |
| |
|
| | #include "nettle-types.h" |
| | #include "bignum.h" |
| |
|
| | #ifdef __cplusplus |
| | extern "C" { |
| | #endif |
| |
|
| | |
| | #define ecc_point_init nettle_ecc_point_init |
| | #define ecc_point_clear nettle_ecc_point_clear |
| | #define ecc_point_set nettle_ecc_point_set |
| | #define ecc_point_get nettle_ecc_point_get |
| | #define ecc_point_mul nettle_ecc_point_mul |
| | #define ecc_point_mul_g nettle_ecc_point_mul_g |
| | #define ecc_scalar_init nettle_ecc_scalar_init |
| | #define ecc_scalar_clear nettle_ecc_scalar_clear |
| | #define ecc_scalar_set nettle_ecc_scalar_set |
| | #define ecc_scalar_get nettle_ecc_scalar_get |
| | #define ecc_scalar_random nettle_ecc_scalar_random |
| | #define ecc_point_mul nettle_ecc_point_mul |
| | #define ecc_bit_size nettle_ecc_bit_size |
| | #define ecc_size nettle_ecc_size |
| | #define ecc_size_a nettle_ecc_size_a |
| | #define ecc_size_j nettle_ecc_size_j |
| |
|
| | struct ecc_curve; |
| |
|
| | |
| |
|
| | |
| | struct ecc_point |
| | { |
| | const struct ecc_curve *ecc; |
| | |
| | mp_limb_t *p; |
| | }; |
| |
|
| | |
| | |
| | struct ecc_scalar |
| | { |
| | const struct ecc_curve *ecc; |
| | |
| | mp_limb_t *p; |
| | }; |
| |
|
| | void |
| | ecc_point_init (struct ecc_point *p, const struct ecc_curve *ecc); |
| | void |
| | ecc_point_clear (struct ecc_point *p); |
| |
|
| | |
| | int |
| | ecc_point_set (struct ecc_point *p, const mpz_t x, const mpz_t y); |
| | void |
| | ecc_point_get (const struct ecc_point *p, mpz_t x, mpz_t y); |
| |
|
| | void |
| | ecc_scalar_init (struct ecc_scalar *s, const struct ecc_curve *ecc); |
| | void |
| | ecc_scalar_clear (struct ecc_scalar *s); |
| |
|
| | |
| | int |
| | ecc_scalar_set (struct ecc_scalar *s, const mpz_t z); |
| | void |
| | ecc_scalar_get (const struct ecc_scalar *s, mpz_t z); |
| | |
| | |
| | void |
| | ecc_scalar_random (struct ecc_scalar *s, |
| | void *random_ctx, nettle_random_func *random); |
| |
|
| | |
| | void |
| | ecc_point_mul (struct ecc_point *r, const struct ecc_scalar *n, |
| | const struct ecc_point *p); |
| |
|
| | |
| | void |
| | ecc_point_mul_g (struct ecc_point *r, const struct ecc_scalar *n); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | unsigned |
| | ecc_bit_size (const struct ecc_curve *ecc); |
| |
|
| | |
| | mp_size_t |
| | ecc_size (const struct ecc_curve *ecc); |
| |
|
| | |
| | mp_size_t |
| | ecc_size_a (const struct ecc_curve *ecc); |
| |
|
| | |
| | mp_size_t |
| | ecc_size_j (const struct ecc_curve *ecc); |
| |
|
| | |
| | |
| |
|
| | #ifdef __cplusplus |
| | } |
| | #endif |
| |
|
| | #endif |
| |
|