Utility module for checking whether NIST P-256 (secp256r1) ECC keys can be compressed to only their X coordinate. This implementation implements the strategy described in https://tools.ietf.org/html/draft-jivsov-ecc-compact-05 and is based on a 1986 publication by Victor Miller in 'CRYPTO 85'. This method is believed to be unpatentable. See https://cr.yp.to/ecdh/patents.html for more details.
The implementation is done as a NIF linked against the system's libcrypto.ecc_coordinate() = <<_:256>>
ecc_point() = <<_:520>>
ecc_private_key() = #'ECPrivateKey'{}
ecc_public_key() = {#'ECPoint'{}, {namedCurve, '?secp256r1'}}
generate_key/0 | Generate a NIST p-256 key that is compliant with the compactness restrictions. |
is_compact/1 | Returns whether a given key is compliant with the compactness restrictions. |
recover_key/1 | Given the X coordinate of a public key from a compliant point on the curve, return the public key. |
generate_key() -> {ok, ecc_private_key(), ecc_coordinate()}
Generate a NIST p-256 key that is compliant with the compactness restrictions.
is_compact(PubKey::ecc_private_key() | ecc_public_key() | ecc_point()) -> {true, ecc_coordinate()} | false
Returns whether a given key is compliant with the compactness restrictions. In the case that the key is compliant, also return the bare X coordinate.
recover_key(X::ecc_coordinate()) -> ecc_public_key()
Given the X coordinate of a public key from a compliant point on the curve, return the public key.
Generated by EDoc