107 uint8_t *plainText, uint16_t textLen,
108 uint8_t *addDataBuf, uint16_t addBufLen,
109 uint8_t *aesKey, uint8_t *MAC, uint8_t ccmLVal);
132 uint8_t *cipherText, uint16_t textLen,
133 uint8_t *addDataBuf, uint16_t addBufLen,
134 uint8_t *aesKey, uint8_t *MAC, uint8_t ccmLVal);
150 uint8_t *aesKey, uint8_t *nonce,
151 uint8_t *initVector);
167 uint8_t *aesKey, uint8_t *nonce,
168 uint8_t *initVector);
179 #define ECC_WINDOW_SIZE 3
185 #define ECC_PRIME_NIST256_CURVE
191 #define ECC_MODULUS_EVEN 0xDC
192 #define ECC_MODULUS_LARGER_THAN_255_WORDS 0xD2
193 #define ECC_MODULUS_LENGTH_ZERO 0x08
194 #define ECC_MODULUS_MSW_IS_ZERO 0x30
195 #define ECC_SCALAR_TOO_LONG 0x35
196 #define ECC_SCALAR_LENGTH_ZERO 0x53
197 #define ECC_ORDER_TOO_LONG 0xC6
198 #define ECC_ORDER_LENGTH_ZERO 0x6C
199 #define ECC_X_COORD_TOO_LONG 0x3C
200 #define ECC_X_COORD_LENGTH_ZERO 0xC3
201 #define ECC_Y_COORD_TOO_LONG 0x65
202 #define ECC_Y_COORD_LENGTH_ZERO 0x56
203 #define ECC_A_COEF_TOO_LONG 0x5C
204 #define ECC_A_COEF_LENGTH_ZERO 0xC5
205 #define ECC_BAD_WINDOW_SIZE 0x66
206 #define ECC_SCALAR_MUL_OK 0x99
209 #define ECC_ORDER_LARGER_THAN_255_WORDS 0x28
210 #define ECC_ORDER_EVEN 0x82
211 #define ECC_ORDER_MSW_IS_ZERO 0x23
212 #define ECC_ECC_KEY_TOO_LONG 0x25
213 #define ECC_ECC_KEY_LENGTH_ZERO 0x52
214 #define ECC_DIGEST_TOO_LONG 0x27
215 #define ECC_DIGEST_LENGTH_ZERO 0x72
216 #define ECC_ECDSA_SIGN_OK 0x32
217 #define ECC_ECDSA_INVALID_SIGNATURE 0x5A
218 #define ECC_ECDSA_VALID_SIGNATURE 0xA5
219 #define ECC_SIG_P1_TOO_LONG 0x11
220 #define ECC_SIG_P1_LENGTH_ZERO 0x12
221 #define ECC_SIG_P2_TOO_LONG 0x22
222 #define ECC_SIG_P2_LENGTH_ZERO 0x21
224 #define ECC_ECDSA_KEYGEN_OK ECC_SCALAR_MUL_OK
225 #define ECC_ECDH_KEYGEN_OK ECC_SCALAR_MUL_OK
226 #define ECC_ECDH_COMMON_KEY_OK ECC_SCALAR_MUL_OK
258 extern uint8_t
ECC_generateKey(uint32_t *randString, uint32_t *privateKey,
259 uint32_t *publicKey_x, uint32_t *publicKey_y);
274 extern uint8_t
ECC_ECDSA_sign(uint32_t *secretKey, uint32_t *text, uint32_t *randString,
275 uint32_t *sign1, uint32_t *sign2);
290 extern uint8_t
ECC_ECDSA_verify(uint32_t *publicKey_x, uint32_t *publicKey_y,
291 uint32_t *text, uint32_t *sign1, uint32_t *sign2);
307 uint32_t *publicKey_x,
308 uint32_t *publicKey_y,
309 uint32_t *sharedSecret_x,
310 uint32_t *sharedSecret_y);
341 uint32_t bufLen, uint8_t *pBufOut);
uint8_t SHA256_initialize(SHA256_memory_t *workZone)
Intializes the SHA256 engine.
A SHA256_memory_t variable of this type must be allocated before running any SHA256 functions...
uint8_t AES_CTR_DecryptData(uint8_t *cipherText, uint16_t textLen, uint8_t *aesKey, uint8_t *nonce, uint8_t *initVector)
Decrypt ciphertext using the AES key, nonce and initialization vector.
uint8_t AES_CTR_EncryptData(uint8_t *plainText, uint16_t textLen, uint8_t *aesKey, uint8_t *nonce, uint8_t *initVector)
Encrypt plaintext using the AES key, nonce and initialization vector.
int8_t AES_CCM_DecryptData(uint8_t decryptFlag, uint8_t MACLen, uint8_t *nonce, uint8_t *cipherText, uint16_t textLen, uint8_t *addDataBuf, uint16_t addBufLen, uint8_t *aesKey, uint8_t *MAC, uint8_t ccmLVal)
Authenticate and optionally decrypt message cipherText.
uint8_t ECC_generateKey(uint32_t *randString, uint32_t *privateKey, uint32_t *publicKey_x, uint32_t *publicKey_y)
Generate a key.
uint8_t SHA256_execute(SHA256_memory_t *config, uint8_t *pBufIn, uint32_t bufLen)
Perform SHA256.
void AES_ECB_DecryptData(uint8_t *text, uint16_t textLen, uint8_t *aesKey)
Use a random 128 bit key to decrypt data with the AES.
int8_t AES_CCM_EncryptData(uint8_t encryptFlag, uint8_t MACLen, uint8_t *nonce, uint8_t *plainText, uint16_t textLen, uint8_t *addDataBuf, uint16_t addBufLen, uint8_t *aesKey, uint8_t *MAC, uint8_t ccmLVal)
Authenticate and optionally encrypt message plainText.
uint8_t ECC_ECDSA_sign(uint32_t *secretKey, uint32_t *text, uint32_t *randString, uint32_t *sign1, uint32_t *sign2)
Sign data.
void AES_ECB_EncryptData(uint8_t *text, uint16_t textLen, uint8_t *aesKey)
Use a random 128 bit key to encrypt data with the AES.
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.
uint8_t SHA256_output(SHA256_memory_t *memory, uint8_t *pBufOut)
Complete the process by passing the modified data back.
void ECC_initialize(uint32_t *pWorkzone)
Pass pointer to ECC memory allocation to ECC engine.
uint8_t SHA256_runFullAlgorithm(SHA256_memory_t *memory, uint8_t *pBufIn, uint32_t bufLen, uint8_t *pBufOut)
Perform SHA256 on the the input data.
uint8_t ECC_ECDSA_verify(uint32_t *publicKey_x, uint32_t *publicKey_y, uint32_t *text, uint32_t *sign1, uint32_t *sign2)
Verify signature.