libgcrypt

Primitives

Supports ECDH, X25519 and EdDSA on C25519, X448, Ed25519, Ed448, NIST curves, Brainpool curves and secp256k1. Also supports GOST and SM2 signatures.

ECDH

KeyGen:
Derive:
  • Same as Keygen via gcry_pk_encrypt -> _gcry_pk_encrypt -> generate -> ecc_encrypt_raw -> _gcry_mpi_ec_mul_point.

ECDSA

Keygen:
  • Same as ECDH.

Sign:
  • Same as Keygen via gcry_ecc_ecdsa_sign -> _gcry_ecc_ecdsa_sign -> _gcry_mpi_ec_mul_point.

Verify:
  • Two separate scalar multiplications via gcry_ecc_ecdsa_verify -> _gcry_ecc_ecdsa_verify.

EdDSA

Keygen:
Sign:
  • Same as Keygen via gcry_ecc_eddsa_sign -> _gcry_ecc_eddsa_sign -> _gcry_mpi_ec_mul_point.

Verify:
  • Two separate scalar multiplications via gcry_ecc_eddsa_verify -> _gcry_ecc_eddsa_verify.

X25519

KeyGen:
  • Montgomery

  • Montgomery ladder via gcry_pk_genkey -> _gcry_pk_genkey -> generate -> ecc_generate -> nist_generate_key -> _gcry_mpi_ec_mul_point.

  • xz coordinates with a shuffled version of ladd-1987-m-3

Derive:
  • Same as Keygen via gcry_pk_encrypt -> _gcry_pk_encrypt -> generate -> ecc_encrypt_raw -> _gcry_mpi_ec_mul_point.