Lines Matching refs:UINT8

63 void smp_debug_print_nbyte_little_endian(UINT8 *p, const UINT8 *key_name, UINT8 len)  in smp_debug_print_nbyte_little_endian()
69 UINT8 p_buf[512]; in smp_debug_print_nbyte_little_endian()
87 void smp_debug_print_nbyte_big_endian (UINT8 *p, const UINT8 *key_name, UINT8 len) in smp_debug_print_nbyte_big_endian()
90 UINT8 p_buf[512]; in smp_debug_print_nbyte_big_endian()
123 BOOLEAN smp_encrypt_data (UINT8 *key, UINT8 key_len, in smp_encrypt_data()
124 UINT8 *plain_text, UINT8 pt_len, in smp_encrypt_data()
128 UINT8 *p_start = NULL; in smp_encrypt_data()
129 UINT8 *p = NULL; in smp_encrypt_data()
130 UINT8 *p_rev_data = NULL; /* input data in big endilan format */ in smp_encrypt_data()
131 UINT8 *p_rev_key = NULL; /* input key in big endilan format */ in smp_encrypt_data()
132 UINT8 *p_rev_output = NULL; /* encrypted output in big endilan format */ in smp_encrypt_data()
141 p_start = (UINT8 *)osi_calloc(SMP_ENCRYT_DATA_SIZE * 4); in smp_encrypt_data()
154 smp_debug_print_nbyte_little_endian(key, (const UINT8 *)"Key", SMP_ENCRYT_KEY_SIZE); in smp_encrypt_data()
155 smp_debug_print_nbyte_little_endian(p_start, (const UINT8 *)"Plain text", SMP_ENCRYT_DATA_SIZE); in smp_encrypt_data()
164 …smp_debug_print_nbyte_little_endian(p_out->param_buf, (const UINT8 *)"Encrypted text", SMP_ENCRYT_… in smp_encrypt_data()
208 UINT8 *tt = p_cb->tk; in smp_proc_passkey()
211 UINT8 *pp = p->param_buf; in smp_proc_passkey()
387 UINT8 buffer[4]; /* for (r || DIV) r=1*/ in smp_compute_csrk()
389 UINT8 *p=buffer; in smp_compute_csrk()
455 void smp_concatenate_local( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code) in smp_concatenate_local()
457 UINT8 *p = *p_data; in smp_concatenate_local()
475 void smp_concatenate_peer( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code) in smp_concatenate_peer()
477 UINT8 *p = *p_data; in smp_concatenate_peer()
503 UINT8 *p = (UINT8 *)p1; in smp_gen_p1_4_confirm()
541 smp_debug_print_nbyte_little_endian ((UINT8 *)p1, (const UINT8 *)"P1", 16); in smp_gen_p1_4_confirm()
557 UINT8 *p = (UINT8 *)p2; in smp_gen_p2_4_confirm()
587 smp_debug_print_nbyte_little_endian(p2, (const UINT8 *)"p2", 16); in smp_gen_p2_4_confirm()
615 smp_debug_print_nbyte_little_endian ((UINT8 *)p1, (const UINT8 *)"P1' = r XOR p1", 16); in smp_calculate_comfirm()
648 smp_debug_print_nbyte_little_endian (p->param_buf, (const UINT8 *)"C1", 16); in smp_calculate_comfirm_cont()
655 smp_debug_print_nbyte_little_endian ((UINT8 *)p2, (const UINT8 *)"p2' = C1 xor p2", 16); in smp_calculate_comfirm_cont()
694 smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->rand, (const UINT8 *)"local rand", 16); in smp_generate_confirm()
715 smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->rrand, (const UINT8 *)"peer rand", 16); in smp_generate_compare()
738 smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->confirm, (const UINT8 *)"Confirm", 16); in smp_process_confirm()
763 smp_debug_print_nbyte_little_endian (p->param_buf, (const UINT8 *)"Compare", 16); in smp_process_compare()
818 if (!SMP_Encrypt(er, BT_OCTET16_LEN, (UINT8 *)&p_cb->div, in smp_generate_ltk_cont()
900 UINT8 *pp= p->param_buf; in smp_process_ediv()
928 UINT8 *p = ptext; in smp_calculate_legacy_short_term_key()
1021 UINT8 state = p_cb->rand_enc_proc_state & ~0x80; in smp_continue_private_key_creation()
1082 smp_debug_print_nbyte_little_endian (p_cb->private_key, (const UINT8 *)"private", in smp_process_private_key()
1084 smp_debug_print_nbyte_little_endian (p_cb->loc_publ_key.x, (const UINT8 *)"local public(x)", in smp_process_private_key()
1086 smp_debug_print_nbyte_little_endian (p_cb->loc_publ_key.y, (const UINT8 *)"local public(y)", in smp_process_private_key()
1119 smp_debug_print_nbyte_little_endian (p_cb->dhkey, (const UINT8 *)"Old DHKey", in smp_compute_dhkey()
1122 smp_debug_print_nbyte_little_endian (p_cb->private_key, (const UINT8 *)"private", in smp_compute_dhkey()
1124 smp_debug_print_nbyte_little_endian (p_cb->peer_publ_key.x, (const UINT8 *)"rem public(x)", in smp_compute_dhkey()
1126 smp_debug_print_nbyte_little_endian (p_cb->peer_publ_key.y, (const UINT8 *)"rem public(y)", in smp_compute_dhkey()
1128 smp_debug_print_nbyte_little_endian (p_cb->dhkey, (const UINT8 *)"Reverted DHKey", in smp_compute_dhkey()
1143 UINT8 random_input; in smp_calculate_local_commitment()
1189 UINT8 ri; in smp_calculate_peer_commitment()
1242 void smp_calculate_f4(UINT8 *u, UINT8 *v, UINT8 *x, UINT8 z, UINT8 *c) in smp_calculate_f4()
1244 UINT8 msg_len = BT_OCTET32_LEN /* U size */ + BT_OCTET32_LEN /* V size */ + 1 /* Z size */; in smp_calculate_f4()
1245 UINT8 msg[BT_OCTET32_LEN + BT_OCTET32_LEN + 1]; in smp_calculate_f4()
1246 UINT8 key[BT_OCTET16_LEN]; in smp_calculate_f4()
1247 UINT8 cmac[BT_OCTET16_LEN]; in smp_calculate_f4()
1248 UINT8 *p = NULL; in smp_calculate_f4()
1250 UINT8 *p_prnt = NULL; in smp_calculate_f4()
1257 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"U", BT_OCTET32_LEN); in smp_calculate_f4()
1259 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"V", BT_OCTET32_LEN); in smp_calculate_f4()
1261 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"X", BT_OCTET16_LEN); in smp_calculate_f4()
1263 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"Z", 1); in smp_calculate_f4()
1272 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"M", msg_len); in smp_calculate_f4()
1279 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_f4()
1285 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"AES_CMAC", BT_OCTET16_LEN); in smp_calculate_f4()
1322 UINT8 reason; in smp_calculate_numeric_comparison_display_number()
1357 UINT32 smp_calculate_g2(UINT8 *u, UINT8 *v, UINT8 *x, UINT8 *y) in smp_calculate_g2()
1359 UINT8 msg_len = BT_OCTET32_LEN /* U size */ + BT_OCTET32_LEN /* V size */ in smp_calculate_g2()
1361 UINT8 msg[BT_OCTET32_LEN + BT_OCTET32_LEN + BT_OCTET16_LEN]; in smp_calculate_g2()
1362 UINT8 key[BT_OCTET16_LEN]; in smp_calculate_g2()
1363 UINT8 cmac[BT_OCTET16_LEN]; in smp_calculate_g2()
1364 UINT8 *p = NULL; in smp_calculate_g2()
1367 UINT8 *p_prnt = NULL; in smp_calculate_g2()
1378 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"U", BT_OCTET32_LEN); in smp_calculate_g2()
1380 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"V", BT_OCTET32_LEN); in smp_calculate_g2()
1382 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"X", BT_OCTET16_LEN); in smp_calculate_g2()
1384 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"Y", BT_OCTET16_LEN); in smp_calculate_g2()
1391 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_g2()
1402 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"AES-CMAC", BT_OCTET16_LEN); in smp_calculate_g2()
1409 p_prnt = (UINT8 *) &vres; in smp_calculate_g2()
1410 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"cmac mod 2**32", 4); in smp_calculate_g2()
1416 p_prnt = (UINT8 *) &vres; in smp_calculate_g2()
1417 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"cmac mod 2**32 mod 10**6", 4); in smp_calculate_g2()
1479 BOOLEAN smp_calculate_f5(UINT8 *w, UINT8 *n1, UINT8 *n2, UINT8 *a1, UINT8 *a2, in smp_calculate_f5()
1480 UINT8 *mac_key, UINT8 *ltk) in smp_calculate_f5()
1485 UINT8 *p_prnt = NULL; in smp_calculate_f5()
1493 UINT8 counter_mac_key[1] = {0}; in smp_calculate_f5()
1494 UINT8 counter_ltk[1] = {1}; in smp_calculate_f5()
1498 UINT8 key_id[4] = {0x65, 0x6c, 0x74, 0x62}; in smp_calculate_f5()
1502 UINT8 length[2] = {0x00, 0x01}; in smp_calculate_f5()
1507 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"W", BT_OCTET32_LEN); in smp_calculate_f5()
1509 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"N1", BT_OCTET16_LEN); in smp_calculate_f5()
1511 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"N2", BT_OCTET16_LEN); in smp_calculate_f5()
1513 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"A1", 7); in smp_calculate_f5()
1515 smp_debug_print_nbyte_little_endian (p_prnt,(const UINT8 *) "A2", 7); in smp_calculate_f5()
1525 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"T", BT_OCTET16_LEN); in smp_calculate_f5()
1536 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"MacKey", BT_OCTET16_LEN); in smp_calculate_f5()
1547 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"LTK", BT_OCTET16_LEN); in smp_calculate_f5()
1585 BOOLEAN smp_calculate_f5_mackey_or_long_term_key(UINT8 *t, UINT8 *counter, in smp_calculate_f5_mackey_or_long_term_key()
1586 UINT8 *key_id, UINT8 *n1, UINT8 *n2, UINT8 *a1, UINT8 *a2, in smp_calculate_f5_mackey_or_long_term_key()
1587 UINT8 *length, UINT8 *mac) in smp_calculate_f5_mackey_or_long_term_key()
1589 UINT8 *p = NULL; in smp_calculate_f5_mackey_or_long_term_key()
1590 UINT8 cmac[BT_OCTET16_LEN]; in smp_calculate_f5_mackey_or_long_term_key()
1591 UINT8 key[BT_OCTET16_LEN]; in smp_calculate_f5_mackey_or_long_term_key()
1592 UINT8 msg_len = 1 /* Counter size */ + 4 /* keyID size */ + in smp_calculate_f5_mackey_or_long_term_key()
1595 UINT8 msg[1 + 4 + BT_OCTET16_LEN + BT_OCTET16_LEN + 7 + 7 + 2]; in smp_calculate_f5_mackey_or_long_term_key()
1598 UINT8 *p_prnt = NULL; in smp_calculate_f5_mackey_or_long_term_key()
1604 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"T", BT_OCTET16_LEN); in smp_calculate_f5_mackey_or_long_term_key()
1606 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"Counter", 1); in smp_calculate_f5_mackey_or_long_term_key()
1608 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"KeyID", 4); in smp_calculate_f5_mackey_or_long_term_key()
1610 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"N1", BT_OCTET16_LEN); in smp_calculate_f5_mackey_or_long_term_key()
1612 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"N2", BT_OCTET16_LEN); in smp_calculate_f5_mackey_or_long_term_key()
1614 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"A1", 7); in smp_calculate_f5_mackey_or_long_term_key()
1616 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"A2", 7); in smp_calculate_f5_mackey_or_long_term_key()
1618 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"Length", 2); in smp_calculate_f5_mackey_or_long_term_key()
1625 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_f5_mackey_or_long_term_key()
1637 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"M", msg_len); in smp_calculate_f5_mackey_or_long_term_key()
1648 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"AES-CMAC", BT_OCTET16_LEN); in smp_calculate_f5_mackey_or_long_term_key()
1675 BOOLEAN smp_calculate_f5_key(UINT8 *w, UINT8 *t) in smp_calculate_f5_key()
1677 UINT8 *p = NULL; in smp_calculate_f5_key()
1687 UINT8 *p_prnt = NULL; in smp_calculate_f5_key()
1693 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"salt", BT_OCTET16_LEN); in smp_calculate_f5_key()
1695 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"W", BT_OCTET32_LEN); in smp_calculate_f5_key()
1707 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_f5_key()
1709 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"M", BT_OCTET32_LEN); in smp_calculate_f5_key()
1722 smp_debug_print_nbyte_little_endian (p_prnt, (const UINT8 *)"AES-CMAC", BT_OCTET16_LEN); in smp_calculate_f5_key()
1745 UINT8 iocap[3], a[7], b[7]; in smp_calculate_local_dhkey_check()
1772 UINT8 iocap[3], a[7], b[7]; in smp_calculate_peer_dhkey_check()
1791 smp_debug_print_nbyte_little_endian (param_buf, (const UINT8 *)"peer DHKey check", in smp_calculate_peer_dhkey_check()
1828 BOOLEAN smp_calculate_f6(UINT8 *w, UINT8 *n1, UINT8 *n2, UINT8 *r, UINT8 *iocap, UINT8 *a1, in smp_calculate_f6()
1829 UINT8 *a2, UINT8 *c) in smp_calculate_f6()
1831 UINT8 *p = NULL; in smp_calculate_f6()
1832 UINT8 msg_len = BT_OCTET16_LEN /* N1 size */ + BT_OCTET16_LEN /* N2 size */ + in smp_calculate_f6()
1835 UINT8 msg[BT_OCTET16_LEN + BT_OCTET16_LEN + BT_OCTET16_LEN + 3 + 7 + 7]; in smp_calculate_f6()
1837 UINT8 *p_print = NULL; in smp_calculate_f6()
1843 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"W", BT_OCTET16_LEN); in smp_calculate_f6()
1845 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"N1", BT_OCTET16_LEN); in smp_calculate_f6()
1847 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"N2", BT_OCTET16_LEN); in smp_calculate_f6()
1849 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"R", BT_OCTET16_LEN); in smp_calculate_f6()
1851 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"IOcap", 3); in smp_calculate_f6()
1853 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"A1", 7); in smp_calculate_f6()
1855 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"A2", 7); in smp_calculate_f6()
1858 UINT8 cmac[BT_OCTET16_LEN]; in smp_calculate_f6()
1859 UINT8 key[BT_OCTET16_LEN]; in smp_calculate_f6()
1865 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_f6()
1877 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"M", msg_len); in smp_calculate_f6()
1889 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"AES-CMAC", BT_OCTET16_LEN); in smp_calculate_f6()
1940 ret = smp_calculate_h6(p_cb->ltk, (UINT8 *)"1pmt" /* reversed "tmp1" */,intermediate_link_key); in smp_calculate_link_key_from_long_term_key()
1948 ret = smp_calculate_h6(intermediate_link_key, (UINT8 *) "rbel" /* reversed "lebr" */, link_key); in smp_calculate_link_key_from_long_term_key()
1955 UINT8 link_key_type; in smp_calculate_link_key_from_long_term_key()
1986 UINT8 *p; in smp_calculate_link_key_from_long_term_key()
2013 UINT8 rev_link_key[16]; in smp_calculate_long_term_key_from_link_key()
2023 UINT8 br_link_key_type; in smp_calculate_long_term_key_from_link_key()
2039 UINT8 *p1; in smp_calculate_long_term_key_from_link_key()
2040 UINT8 *p2; in smp_calculate_long_term_key_from_link_key()
2047 ret = smp_calculate_h6(rev_link_key, (UINT8 *) "2pmt" /* reversed "tmp2" */, in smp_calculate_long_term_key_from_link_key()
2057 ret = smp_calculate_h6(intermediate_long_term_key, (UINT8 *) "elrb" /* reversed "brle" */, in smp_calculate_long_term_key_from_link_key()
2092 BOOLEAN smp_calculate_h6(UINT8 *w, UINT8 *keyid, UINT8 *c) in smp_calculate_h6()
2095 UINT8 *p_print = NULL; in smp_calculate_h6()
2101 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"W", BT_OCTET16_LEN); in smp_calculate_h6()
2103 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"keyID", 4); in smp_calculate_h6()
2106 UINT8 *p = NULL; in smp_calculate_h6()
2107 UINT8 key[BT_OCTET16_LEN]; in smp_calculate_h6()
2114 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"K", BT_OCTET16_LEN); in smp_calculate_h6()
2117 UINT8 msg_len = 4 /* KeyID size */; in smp_calculate_h6()
2118 UINT8 msg[4]; in smp_calculate_h6()
2125 smp_debug_print_nbyte_little_endian (p_print,(const UINT8 *) "M", msg_len); in smp_calculate_h6()
2129 UINT8 cmac[BT_OCTET16_LEN]; in smp_calculate_h6()
2138 smp_debug_print_nbyte_little_endian (p_print, (const UINT8 *)"AES-CMAC", BT_OCTET16_LEN); in smp_calculate_h6()
2208 UINT8 *pp = p->param_buf; in smp_rand_back()
2209 UINT8 failure = SMP_PAIR_FAIL_UNKNOWN; in smp_rand_back()
2210 UINT8 state = p_cb->rand_enc_proc_state & ~0x80; in smp_rand_back()