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