ECC Library#
Elliptic Curve Cryptography Library.
The Elliptic Curve Cryptography (ECC) API includes ECDSA verification on one of the elliptic curves recommended by NIST in csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf :
secp256r1: NIST/SECG X9.62 curve over a 256 bit prime field
Modules#
Typedefs#
ECC big integer type.
Functions#
Functions **********************************.
Convert a large integer from a hexadecimal string to the ECC_BigInt_t format.
Convert a large integer from the ECC_BigInt_t to a hexadecimal string format.
Convert a big integer from a byte array to the ECC_BigInt_t format.
Convert a large integer from the ECC_BigInt_t to the byte array format.
Convert an integer from uint32_t to ECC_BigInt_t format.
Macros#
TYPEDEFS **********************************.
ECC big integer size in bytes.
ECC big integer size in words.
Typedef Documentation#
ECC_BigInt_t#
typedef uint32_t ECC_BigInt_t[ECC_BIGINT_SIZE_IN_32BIT_WORDS] [ECC_BIGINT_SIZE_IN_32BIT_WORDS]
ECC big integer type.
59
of file platform/bootloader/security/ecc/ecc.h
Function Documentation#
ECC_ECDSA_VerifySignatureP256#
int32_t ECC_ECDSA_VerifySignatureP256 (CRYPTO_TypeDef * crypto, const uint8_t * msgDigest, int msgDigestLen, const ECC_Point_t * publicKey, ECC_EcdsaSignature_t * signature)
Functions **********************************.
[in] | crypto | Pointer to CRYPTO peripheral instance |
[in] | msgDigest | The message digest associated with the signature. |
[in] | msgDigestLen | The length of the message digest. |
[in] | publicKey | Public key of entity that generated signature. |
[out] | signature | The signature to verify. |
Verify an ECDSA signature.
TBW
Returns
Error code.
102
of file platform/bootloader/security/ecc/ecc.h
ECC_HexToBigInt#
void ECC_HexToBigInt (ECC_BigInt_t bigint, const char * hex)
Convert a large integer from a hexadecimal string to the ECC_BigInt_t format.
[out] | bigint | Pointer to the location where to store the result. |
[in] | hex | The hex representation of the large integer to convert. |
Convert a large integer from a hexadecimal string representation to a ECC_BigInt_t representation.
120
of file platform/bootloader/security/ecc/ecc.h
ECC_BigIntToHex#
void ECC_BigIntToHex (char * hex, ECC_BigInt_t bigint)
Convert a large integer from the ECC_BigInt_t to a hexadecimal string format.
[out] | hex | Buffer where to store the hexadecimal result. |
[in] | bigint | The ECC_BigInt_t representation of the large integer to convert. |
Convert a large integer from a ECC_BigInt_t representation to a hexadecimal string representation.
134
of file platform/bootloader/security/ecc/ecc.h
ECC_ByteArrayToBigInt#
void ECC_ByteArrayToBigInt (ECC_BigInt_t bigint, const uint8_t * bytearray)
Convert a big integer from a byte array to the ECC_BigInt_t format.
[out] | bigint | Pointer to the location where to store the result. |
[in] | bytearray | The byte array representation of the large integer to convert. |
Convert a large integer from a byte array representation to a ECC_BigInt_t representation.
148
of file platform/bootloader/security/ecc/ecc.h
ECC_BigIntToByteArray#
void ECC_BigIntToByteArray (uint8_t * bytearray, ECC_BigInt_t bigint)
Convert a large integer from the ECC_BigInt_t to the byte array format.
[out] | bytearray | Buffer to store the resulting byte array. |
[in] | bigint | The ECC_BigInt_t representation of the large integer to convert. |
Convert a large integer from a ECC_BigInt_t representation to a byte array representation. Caution: byte array must be big enough to contain the result.
163
of file platform/bootloader/security/ecc/ecc.h
ECC_UnsignedIntToBigInt#
void ECC_UnsignedIntToBigInt (ECC_BigInt_t bigint, const uint32_t value)
Convert an integer from uint32_t to ECC_BigInt_t format.
[out] | bigint | Pointer to the location to store the result. |
[in] | value | The value to convert. |
Convert a integer from an uint32_t representation to a ECC_BigInt_t representation.
176
of file platform/bootloader/security/ecc/ecc.h
Macro Definition Documentation#
ECC_BIGINT_SIZE_IN_BITS#
#define ECC_BIGINT_SIZE_IN_BITSValue:
(256)
TYPEDEFS **********************************.
ECC big integer size in bits.
49
of file platform/bootloader/security/ecc/ecc.h
ECC_BIGINT_SIZE_IN_BYTES#
#define ECC_BIGINT_SIZE_IN_BYTESValue:
(ECC_BIGINT_SIZE_IN_BITS / 8)
ECC big integer size in bytes.
52
of file platform/bootloader/security/ecc/ecc.h
ECC_BIGINT_SIZE_IN_32BIT_WORDS#
#define ECC_BIGINT_SIZE_IN_32BIT_WORDSValue:
ECC big integer size in words.
55
of file platform/bootloader/security/ecc/ecc.h