diff options
Diffstat (limited to 'cipher/ecc-misc.c')
-rw-r--r-- | cipher/ecc-misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cipher/ecc-misc.c b/cipher/ecc-misc.c index 5e06bef9..5c86121a 100644 --- a/cipher/ecc-misc.c +++ b/cipher/ecc-misc.c @@ -64,6 +64,25 @@ _gcry_ecc_curve_copy (elliptic_curve_t E) } +/* + * Return a description of the curve model. + */ +const char * +_gcry_ecc_model2str (enum gcry_mpi_ec_models model) +{ + const char *str = "?"; + switch (model) + { + case MPI_EC_WEIERSTRASS: str = "Weierstrass"; break; + case MPI_EC_MONTGOMERY: str = "Montgomery"; break; + case MPI_EC_TWISTEDEDWARDS: str = "Twisted Edwards"; break; + } + return str; +} + + + + gcry_mpi_t _gcry_ecc_ec2os (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t p) { |