ECC supported curves
With ECC, you must choose the domain parameters that define what curve you are going to work on when creating an empty key-shell. NanoCrypto supports the five curves defined by FIPS PUB 186-4 (P192, P224, P256, P384, P521) and the two Edward’s form curves defined in RFC 7748 (curve25519 and curve448).
To choose a curve, select the appropriate identifier from ${MSS_SRC_PKG}/src/crypto/ca_mgmt.h
:
cid_EC_P192
cid_EC_P224
cid_EC_P256
cid_EC_P384
cid_EC_P521
cid_EC_X25519
cid_EC_X448
cid_EC_Ed25519
cid_EC_Ed448
Note that curve25519 and curve448 each have two identifiers, one for if the key will be used for signatures (edDSA, abbreviated in the identifier as Ed
), and one for if the key will be used for key exchange (edDH, abbreviated in the identifier as X
). For Edward’s curves, such keys are not interchangeable. Edward’s curves are not available for ElGamal.
For example, to create a key on curve P256, call the following:
ubyte4 curveId = cid_EC_P256; ECCKey *pKey = NULL; CRYPTO_INTERFACE_EC_newKeyAux(curveId, &pKey);