Lines Matching full:16

16 static const uint8_t osdp_scbk_default[16] = {
40 for (i = 8; i < 16; i++) { in osdp_compute_scbk()
43 osdp_encrypt(master_key, NULL, scbk, 16); in osdp_compute_scbk()
50 uint8_t scbk[16]; in osdp_compute_session_keys()
53 memcpy(scbk, osdp_scbk_default, 16); in osdp_compute_session_keys()
58 memcpy(scbk, pd->sc.scbk, 16); in osdp_compute_session_keys()
62 memset(pd->sc.s_enc, 0, 16); in osdp_compute_session_keys()
63 memset(pd->sc.s_mac1, 0, 16); in osdp_compute_session_keys()
64 memset(pd->sc.s_mac2, 0, 16); in osdp_compute_session_keys()
79 osdp_encrypt(scbk, NULL, pd->sc.s_enc, 16); in osdp_compute_session_keys()
80 osdp_encrypt(scbk, NULL, pd->sc.s_mac1, 16); in osdp_compute_session_keys()
81 osdp_encrypt(scbk, NULL, pd->sc.s_mac2, 16); in osdp_compute_session_keys()
89 osdp_encrypt(pd->sc.s_enc, NULL, pd->sc.cp_cryptogram, 16); in osdp_compute_cp_cryptogram()
112 uint8_t cp_crypto[16]; in osdp_verify_cp_cryptogram()
117 osdp_encrypt(pd->sc.s_enc, NULL, cp_crypto, 16); in osdp_verify_cp_cryptogram()
119 if (osdp_ct_compare(pd->sc.cp_cryptogram, cp_crypto, 16) != 0) { in osdp_verify_cp_cryptogram()
130 osdp_encrypt(pd->sc.s_enc, NULL, pd->sc.pd_cryptogram, 16); in osdp_compute_pd_cryptogram()
135 uint8_t pd_crypto[16]; in osdp_verify_pd_cryptogram()
140 osdp_encrypt(pd->sc.s_enc, NULL, pd_crypto, 16); in osdp_verify_pd_cryptogram()
142 if (osdp_ct_compare(pd->sc.pd_cryptogram, pd_crypto, 16) != 0) { in osdp_verify_pd_cryptogram()
151 memcpy(pd->sc.r_mac, pd->sc.cp_cryptogram, 16); in osdp_compute_rmac_i()
152 osdp_encrypt(pd->sc.s_mac1, NULL, pd->sc.r_mac, 16); in osdp_compute_rmac_i()
153 osdp_encrypt(pd->sc.s_mac2, NULL, pd->sc.r_mac, 16); in osdp_compute_rmac_i()
159 uint8_t iv[16]; in osdp_decrypt_data()
161 if (length <= 0 || length % 16 != 0) { in osdp_decrypt_data()
165 memcpy(iv, is_cmd ? pd->sc.r_mac : pd->sc.c_mac, 16); in osdp_decrypt_data()
166 for (i = 0; i < 16; i++) { in osdp_decrypt_data()
187 uint8_t iv[16]; in osdp_encrypt_data()
194 memcpy(iv, is_cmd ? pd->sc.r_mac : pd->sc.c_mac, 16); in osdp_encrypt_data()
195 for (i = 0; i < 16; i++) { in osdp_encrypt_data()
209 uint8_t iv[16]; in osdp_compute_mac()
212 pad_len = (len % 16 == 0) ? len : AES_PAD_LEN(len); in osdp_compute_mac()
213 if (len % 16 != 0) { in osdp_compute_mac()
223 memcpy(iv, is_cmd ? pd->sc.r_mac : pd->sc.c_mac, 16); in osdp_compute_mac()
224 if (pad_len > 16) { in osdp_compute_mac()
226 osdp_encrypt(pd->sc.s_mac1, iv, buf, pad_len - 16); in osdp_compute_mac()
228 memcpy(iv, buf + pad_len - 32, 16); in osdp_compute_mac()
232 osdp_encrypt(pd->sc.s_mac2, iv, buf + pad_len - 16, 16); in osdp_compute_mac()
233 memcpy(is_cmd ? pd->sc.c_mac : pd->sc.r_mac, buf + pad_len - 16, 16); in osdp_compute_mac()
240 uint8_t scbk[16]; in osdp_sc_setup()
244 memcpy(scbk, pd->sc.scbk, 16); in osdp_sc_setup()
248 memcpy(pd->sc.scbk, scbk, 16); in osdp_sc_setup()