You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
591 B

  1. #ifndef CSIDH_H
  2. #define CSIDH_H
  3. #include "u512.h"
  4. #include "fp.h"
  5. #include "mont.h"
  6. /* specific to p, should perhaps be somewhere else */
  7. #define num_primes 74
  8. #define max_exponent 5 /* (2*5+1)^74 is roughly 2^256 */
  9. typedef struct private_key {
  10. int8_t e[(num_primes + 1) / 2]; /* packed int4_t */
  11. } private_key;
  12. typedef struct public_key {
  13. fp A; /* Montgomery coefficient: represents y^2 = x^3 + Ax^2 + x */
  14. } public_key;
  15. extern const public_key base;
  16. void csidh_private(private_key *priv);
  17. bool csidh(public_key *out, public_key const *in, private_key const *priv);
  18. #endif