Functions | |
void | ECC_initialize (uint32_t *pWorkzone) |
Pass pointer to ECC memory allocation to ECC engine. More... | |
uint8_t | ECC_generateKey (uint32_t *randString, uint32_t *privateKey, uint32_t *publicKey_x, uint32_t *publicKey_y) |
Generate a key. More... | |
uint8_t | ECC_ECDSA_sign (uint32_t *secretKey, uint32_t *text, uint32_t *randString, uint32_t *sign1, uint32_t *sign2) |
Sign data. More... | |
uint8_t | ECC_ECDSA_verify (uint32_t *publicKey_x, uint32_t *publicKey_y, uint32_t *text, uint32_t *sign1, uint32_t *sign2) |
Verify signature. More... | |
uint8_t | ECC_ECDH_computeSharedSecret (uint32_t *privateKey, uint32_t *publicKey_x, uint32_t *publicKey_y, uint32_t *sharedSecret_x, uint32_t *sharedSecret_y) |
Compute the shared secret. More... | |
uint8_t ECC_ECDH_computeSharedSecret | ( | uint32_t * | privateKey, |
uint32_t * | publicKey_x, | ||
uint32_t * | publicKey_y, | ||
uint32_t * | sharedSecret_x, | ||
uint32_t * | sharedSecret_y | ||
) |
Compute the shared secret.
privateKey | Pointer to private key, input. |
publicKey_x | Pointer to public key X-coordinate, input. |
publicKey_y | Pointer to public key Y-coordinate, input. |
sharedSecret_x | Pointer to shared secret X-coordinate, output. |
sharedSecret_y | Pointer to shared secret Y-coordinate, output. |
uint8_t ECC_ECDSA_sign | ( | uint32_t * | secretKey, |
uint32_t * | text, | ||
uint32_t * | randString, | ||
uint32_t * | sign1, | ||
uint32_t * | sign2 | ||
) |
Sign data.
secretKey | Pointer to the secret key, input. |
text | Pointer to the message, input. |
randString | Pointer to random string, input. |
sign1 | Pointer to signature part 1, output. |
sign2 | Pointer to signature part 2, output. |
uint8_t ECC_ECDSA_verify | ( | uint32_t * | publicKey_x, |
uint32_t * | publicKey_y, | ||
uint32_t * | text, | ||
uint32_t * | sign1, | ||
uint32_t * | sign2 | ||
) |
Verify signature.
publicKey_x | Pointer to public key X-coordinate, input. |
publicKey_y | Pointer to public key Y-coordinate, input. |
text | Pointer to message data, input. |
sign1 | Pointer to signature part 1, input. |
sign2 | Pointer to signature part 2, input. |
uint8_t ECC_generateKey | ( | uint32_t * | randString, |
uint32_t * | privateKey, | ||
uint32_t * | publicKey_x, | ||
uint32_t * | publicKey_y | ||
) |
Generate a key.
This is used for both ECDH and ECDSA.
randString | Pointer to random string, input. |
privateKey | Pointer to the private key, output. |
publicKey_x | Pointer to public key X-coordinate, output. |
publicKey_y | Pointer to public key Y-coordinate, output. |
void ECC_initialize | ( | uint32_t * | pWorkzone | ) |
Pass pointer to ECC memory allocation to ECC engine.
This function can be called again to point the ECC workzone at a different memory buffer.
pWorkzone | Pointer to memory allocated for computations, input. See description at beginning of ECC section for memory requirements. |
#define ECC_A_COEF_LENGTH_ZERO 0xC5 |
#define ECC_A_COEF_TOO_LONG 0x5C |
#define ECC_BAD_WINDOW_SIZE 0x66 |
#define ECC_DIGEST_LENGTH_ZERO 0x72 |
#define ECC_DIGEST_TOO_LONG 0x27 |
#define ECC_ECC_KEY_LENGTH_ZERO 0x52 |
#define ECC_ECC_KEY_TOO_LONG 0x25 |
#define ECC_ECDH_COMMON_KEY_OK ECC_SCALAR_MUL_OK |
#define ECC_ECDH_KEYGEN_OK ECC_SCALAR_MUL_OK |
#define ECC_ECDSA_INVALID_SIGNATURE 0x5A |
#define ECC_ECDSA_KEYGEN_OK ECC_SCALAR_MUL_OK |
#define ECC_ECDSA_SIGN_OK 0x32 |
#define ECC_ECDSA_VALID_SIGNATURE 0xA5 |
#define ECC_MODULUS_EVEN 0xDC |
#define ECC_MODULUS_LARGER_THAN_255_WORDS 0xD2 |
#define ECC_MODULUS_LENGTH_ZERO 0x08 |
#define ECC_MODULUS_MSW_IS_ZERO 0x30 |
#define ECC_ORDER_EVEN 0x82 |
#define ECC_ORDER_LARGER_THAN_255_WORDS 0x28 |
#define ECC_ORDER_LENGTH_ZERO 0x6C |
#define ECC_ORDER_MSW_IS_ZERO 0x23 |
#define ECC_ORDER_TOO_LONG 0xC6 |
#define ECC_PRIME_NIST256_CURVE |
#define ECC_SCALAR_LENGTH_ZERO 0x53 |
#define ECC_SCALAR_MUL_OK 0x99 |
#define ECC_SCALAR_TOO_LONG 0x35 |
#define ECC_SIG_P1_LENGTH_ZERO 0x12 |
#define ECC_SIG_P1_TOO_LONG 0x11 |
#define ECC_SIG_P2_LENGTH_ZERO 0x21 |
#define ECC_SIG_P2_TOO_LONG 0x22 |
#define ECC_WINDOW_SIZE 3 |
Referenced by ECC_initialize().
#define ECC_X_COORD_LENGTH_ZERO 0xC3 |
#define ECC_X_COORD_TOO_LONG 0x3C |
#define ECC_Y_COORD_LENGTH_ZERO 0x56 |
#define ECC_Y_COORD_TOO_LONG 0x65 |