/tinycrypt-3.7.0/lib/source/ |
D | cmac_mode.c | 97 int tc_cmac_setup(TCCmacState_t s, const uint8_t *key, TCAesKeySched_t sched) in tc_cmac_setup() argument 101 if (s == (TCCmacState_t) 0 || in tc_cmac_setup() 107 _set(s, 0, sizeof(*s)); in tc_cmac_setup() 108 s->sched = sched; in tc_cmac_setup() 111 tc_aes128_set_encrypt_key(s->sched, key); in tc_cmac_setup() 114 _set(s->iv, 0, TC_AES_BLOCK_SIZE); in tc_cmac_setup() 115 tc_aes_encrypt(s->iv, s->iv, s->sched); in tc_cmac_setup() 116 gf_double (s->K1, s->iv); in tc_cmac_setup() 117 gf_double (s->K2, s->K1); in tc_cmac_setup() 120 tc_cmac_init(s); in tc_cmac_setup() [all …]
|
D | aes_decrypt.c | 62 int tc_aes128_set_decrypt_key(TCAesKeySched_t s, const uint8_t *k) in tc_aes128_set_decrypt_key() argument 64 return tc_aes128_set_encrypt_key(s, k); in tc_aes128_set_decrypt_key() 81 static inline void inv_mix_columns(uint8_t *s) in inv_mix_columns() argument 85 mult_row_column(t, s); in inv_mix_columns() 86 mult_row_column(&t[Nb], s+Nb); in inv_mix_columns() 87 mult_row_column(&t[2*Nb], s+(2*Nb)); in inv_mix_columns() 88 mult_row_column(&t[3*Nb], s+(3*Nb)); in inv_mix_columns() 89 (void)_copy(s, sizeof(t), t, sizeof(t)); in inv_mix_columns() 92 static inline void add_round_key(uint8_t *s, const unsigned int *k) in add_round_key() argument 94 s[0] ^= (uint8_t)(k[0] >> 24); s[1] ^= (uint8_t)(k[0] >> 16); in add_round_key() [all …]
|
D | sha256.c | 39 int tc_sha256_init(TCSha256State_t s) in tc_sha256_init() argument 42 if (s == (TCSha256State_t) 0) { in tc_sha256_init() 52 _set((uint8_t *) s, 0x00, sizeof(*s)); in tc_sha256_init() 53 s->iv[0] = 0x6a09e667; in tc_sha256_init() 54 s->iv[1] = 0xbb67ae85; in tc_sha256_init() 55 s->iv[2] = 0x3c6ef372; in tc_sha256_init() 56 s->iv[3] = 0xa54ff53a; in tc_sha256_init() 57 s->iv[4] = 0x510e527f; in tc_sha256_init() 58 s->iv[5] = 0x9b05688c; in tc_sha256_init() 59 s->iv[6] = 0x1f83d9ab; in tc_sha256_init() [all …]
|
D | aes_encrypt.c | 70 int tc_aes128_set_encrypt_key(TCAesKeySched_t s, const uint8_t *k) in tc_aes128_set_encrypt_key() argument 79 if (s == (TCAesKeySched_t) 0) { in tc_aes128_set_encrypt_key() 86 s->words[i] = ((uint32_t)k[Nb*i]<<24) | (k[Nb*i+1]<<16) | in tc_aes128_set_encrypt_key() 91 t = s->words[i-1]; in tc_aes128_set_encrypt_key() 95 s->words[i] = s->words[i-Nk] ^ t; in tc_aes128_set_encrypt_key() 101 static inline void add_round_key(uint8_t *s, const unsigned int *k) in add_round_key() argument 103 s[0] ^= (uint8_t)(k[0] >> 24); s[1] ^= (uint8_t)(k[0] >> 16); in add_round_key() 104 s[2] ^= (uint8_t)(k[0] >> 8); s[3] ^= (uint8_t)(k[0]); in add_round_key() 105 s[4] ^= (uint8_t)(k[1] >> 24); s[5] ^= (uint8_t)(k[1] >> 16); in add_round_key() 106 s[6] ^= (uint8_t)(k[1] >> 8); s[7] ^= (uint8_t)(k[1]); in add_round_key() [all …]
|
D | ecc_dsa.c | 105 uECC_word_t s[NUM_ECC_WORDS]; in uECC_sign_with_k() local 106 uECC_word_t *k2[2] = {tmp, s}; in uECC_sign_with_k() 119 carry = regularize_k(k, tmp, s, curve); in uECC_sign_with_k() 146 s[num_n_words - 1] = 0; in uECC_sign_with_k() 147 uECC_vli_set(s, p, num_words); in uECC_sign_with_k() 148 uECC_vli_modMult(s, tmp, s, curve->n, num_n_words); /* s = r*d */ in uECC_sign_with_k() 151 uECC_vli_modAdd(s, tmp, s, curve->n, num_n_words); /* s = e + r*d */ in uECC_sign_with_k() 152 uECC_vli_modMult(s, s, k, curve->n, num_n_words); /* s = (e + r*d) / k */ in uECC_sign_with_k() 153 if (uECC_vli_numBits(s, num_n_words) > (bitcount_t)curve->num_bytes * 8) { in uECC_sign_with_k() 157 uECC_vli_nativeToBytes(signature + curve->num_bytes, curve->num_bytes, s); in uECC_sign_with_k() [all …]
|
/tinycrypt-3.7.0/lib/include/tinycrypt/ |
D | cmac_mode.h | 142 int tc_cmac_setup(TCCmacState_t s, const uint8_t *key, 153 int tc_cmac_erase(TCCmacState_t s); 163 int tc_cmac_init(TCCmacState_t s); 176 int tc_cmac_update(TCCmacState_t s, const uint8_t *data, size_t dlen); 188 int tc_cmac_final(uint8_t *tag, TCCmacState_t s);
|
D | aes.h | 79 int tc_aes128_set_encrypt_key(TCAesKeySched_t s, const uint8_t *k); 94 const TCAesKeySched_t s); 110 int tc_aes128_set_decrypt_key(TCAesKeySched_t s, const uint8_t *k); 124 const TCAesKeySched_t s);
|
D | sha256.h | 87 int tc_sha256_init(TCSha256State_t s); 105 int tc_sha256_update (TCSha256State_t s, const uint8_t *data, size_t datalen); 123 int tc_sha256_final(uint8_t *digest, TCSha256State_t s);
|
/tinycrypt-3.7.0/ |
D | README.zephyr | 8 Any changes to the local version should include Zephyr's TinyCrypt
|