Lines Matching +full:2 +full:kb
232 cprbmem = kcalloc(2, cprbplusparamblen, GFP_KERNEL); in alloc_and_prep_cprbmem()
242 memcpy(preqcblk->func_id, "T2", 2); in alloc_and_prep_cprbmem()
267 memzero_explicit(mem, 2 * (sizeof(struct CPRBX) + paramblen)); in free_cprbmem()
301 u8 subfunc_code[2]; in cca_genseckey()
320 u8 subfunc_code[2]; in cca_genseckey()
334 /* get already prepared memory for 2 cprbs with param block each */ in cca_genseckey()
344 memcpy(preqparm->subfunc_code, "KG", 2); in cca_genseckey()
374 preqparm->lv2.keyid[i].attr = (i == 2 ? 0x30 : 0x10); in cca_genseckey()
443 u8 subfunc_code[2]; in cca_clr2seckey()
461 u8 subfunc_code[2]; in cca_clr2seckey()
475 /* get already prepared memory for 2 cprbs with param block each */ in cca_clr2seckey()
485 memcpy(preqparm->subfunc_code, "CM", 2); in cca_clr2seckey()
583 u8 subfunc_code[2]; in cca_sec2protkey()
598 u8 subfunc_code[2]; in cca_sec2protkey()
606 u8 flags[2]; in cca_sec2protkey()
621 /* get already prepared memory for 2 cprbs with param block each */ in cca_sec2protkey()
631 memcpy(preqparm->subfunc_code, "US", 2); in cca_sec2protkey()
747 u8 subfunc_code[2]; in cca_gencipherkey()
749 char rule_array[2 * 8]; in cca_gencipherkey()
796 } kb; in cca_gencipherkey() member
799 u8 subfunc_code[2]; in cca_gencipherkey()
811 } kb; in cca_gencipherkey() member
815 /* get already prepared memory for 2 cprbs with param block each */ in cca_gencipherkey()
826 memcpy(preqparm->subfunc_code, "GK", 2); in cca_gencipherkey()
827 preqparm->rule_array_len = sizeof(uint16_t) + 2 * 8; in cca_gencipherkey()
828 memcpy(preqparm->rule_array, "AES OP ", 2 * 8); in cca_gencipherkey()
847 /* prepare kb block */ in cca_gencipherkey()
848 preqparm->kb.len = sizeof(preqparm->kb); in cca_gencipherkey()
849 preqparm->kb.tlv1.len = sizeof(preqparm->kb.tlv1); in cca_gencipherkey()
850 preqparm->kb.tlv1.flag = 0x0030; in cca_gencipherkey()
851 preqparm->kb.tlv2.len = sizeof(preqparm->kb.tlv2); in cca_gencipherkey()
852 preqparm->kb.tlv2.flag = 0x0030; in cca_gencipherkey()
853 preqparm->kb.tlv3.len = sizeof(preqparm->kb.tlv3); in cca_gencipherkey()
854 preqparm->kb.tlv3.flag = 0x0030; in cca_gencipherkey()
855 memcpy(preqparm->kb.tlv3.gen_key_id_1, in cca_gencipherkey()
857 preqparm->kb.tlv4.len = sizeof(preqparm->kb.tlv4); in cca_gencipherkey()
858 preqparm->kb.tlv4.flag = 0x0030; in cca_gencipherkey()
859 preqparm->kb.tlv5.len = sizeof(preqparm->kb.tlv5); in cca_gencipherkey()
860 preqparm->kb.tlv5.flag = 0x0030; in cca_gencipherkey()
861 preqparm->kb.tlv6.len = sizeof(preqparm->kb.tlv6); in cca_gencipherkey()
862 preqparm->kb.tlv6.flag = 0x0030; in cca_gencipherkey()
864 /* patch the skeleton key token export flags inside the kb block */ in cca_gencipherkey()
866 t = (struct cipherkeytoken *)preqparm->kb.tlv3.gen_key_id_1; in cca_gencipherkey()
898 if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) || in cca_gencipherkey()
899 prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) { in cca_gencipherkey()
908 prepparm->kb.tlv1.gen_key, in cca_gencipherkey()
916 t = (struct cipherkeytoken *)prepparm->kb.tlv1.gen_key; in cca_gencipherkey()
948 u8 subfunc_code[2]; in _ip_cprb_helper()
974 u8 subfunc_code[2]; in _ip_cprb_helper()
986 } kb; in _ip_cprb_helper() member
991 /* get already prepared memory for 2 cprbs with param block each */ in _ip_cprb_helper()
1002 memcpy(preq_ra_block->subfunc_code, "IP", 2); in _ip_cprb_helper()
1003 preq_ra_block->rule_array_len = sizeof(uint16_t) + 2 * 8; in _ip_cprb_helper()
1006 preqcblk->req_parml = sizeof(struct rule_array_block) + 2 * 8; in _ip_cprb_helper()
1064 if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) || in _ip_cprb_helper()
1065 prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) { in _ip_cprb_helper()
1075 t = (struct cipherkeytoken *)prepparm->kb.tlv1.key_token; in _ip_cprb_helper()
1118 * 2/4 EXOR the clear key in cca_clr2cipherkey()
1132 ZCRYPT_DBF_ERR("%s clear key import 2/4 with CSNBKPI2 failed, rc=%d\n", in cca_clr2cipherkey()
1177 u8 subfunc_code[2]; in cca_cipher2protkey()
1191 } kb; in cca_cipher2protkey() member
1194 u8 subfunc_code[2]; in cca_cipher2protkey()
1202 u8 flags[2]; in cca_cipher2protkey()
1217 } kb; in cca_cipher2protkey() member
1221 /* get already prepared memory for 2 cprbs with param block each */ in cca_cipher2protkey()
1231 memcpy(preqparm->subfunc_code, "AU", 2); in cca_cipher2protkey()
1239 + 2 * sizeof(uint16_t); in cca_cipher2protkey()
1241 /* kb, cca token */ in cca_cipher2protkey()
1242 preqparm->kb.len = keytoklen + 3 * sizeof(uint16_t); in cca_cipher2protkey()
1243 preqparm->kb.cca_key_token_len = keytoklen + 2 * sizeof(uint16_t); in cca_cipher2protkey()
1244 memcpy(preqparm->kb.cca_key_token, ckey, keytoklen); in cca_cipher2protkey()
1342 u8 subfunc_code[2]; in cca_ecc2protkey()
1356 } kb; in cca_ecc2protkey() member
1359 u8 subfunc_code[2]; in cca_ecc2protkey()
1367 u8 flags[2]; in cca_ecc2protkey()
1384 /* get already prepared memory for 2 cprbs with param block each */ in cca_ecc2protkey()
1394 memcpy(preqparm->subfunc_code, "AU", 2); in cca_ecc2protkey()
1402 + 2 * sizeof(uint16_t); in cca_ecc2protkey()
1404 /* kb, cca token */ in cca_ecc2protkey()
1405 preqparm->kb.len = keylen + 3 * sizeof(uint16_t); in cca_ecc2protkey()
1406 preqparm->kb.cca_key_token_len = keylen + 2 * sizeof(uint16_t); in cca_ecc2protkey()
1407 memcpy(preqparm->kb.cca_key_token, key, keylen); in cca_ecc2protkey()
1492 u8 subfunc_code[2]; in cca_query_crypto_facility()
1503 u8 subfunc_code[2]; in cca_query_crypto_facility()
1507 /* get already prepared memory for 2 cprbs with param block each */ in cca_query_crypto_facility()
1517 memcpy(preqparm->subfunc_code, "FQ", 2); in cca_query_crypto_facility()
1679 varray = pg + PAGE_SIZE / 2; in fetch_cca_info()
1680 rlen = vlen = PAGE_SIZE / 2; in fetch_cca_info()
1690 if (ci->old_asym_mk_state == '2') in fetch_cca_info()
1692 if (ci->cur_asym_mk_state == '2') in fetch_cca_info()
1699 if (ci->old_aes_mk_state == '2') in fetch_cca_info()
1701 if (ci->cur_aes_mk_state == '2') in fetch_cca_info()
1709 rlen = vlen = PAGE_SIZE / 2; in fetch_cca_info()
1716 if (ci->old_apka_mk_state == '2') in fetch_cca_info()
1718 if (ci->cur_apka_mk_state == '2') in fetch_cca_info()
1727 return found == 2 ? 0 : -ENOENT; in fetch_cca_info()
1781 ci.cur_aes_mk_state == '2' && in findcard()
1789 ci.cur_aes_mk_state == '2' && in findcard()
1812 ci.cur_aes_mk_state == '2' && in findcard()
1816 ci.old_aes_mk_state == '2' && in findcard()
1915 if (mktype == AES_MK_SET && ci.cur_aes_mk_state != '2') in cca_findcard2()
1917 if (mktype == APKA_MK_SET && ci.cur_apka_mk_state != '2') in cca_findcard2()
1928 if (old_mkvp && ci.old_aes_mk_state == '2' && in cca_findcard2()
1934 if (old_mkvp && ci.old_apka_mk_state == '2' && in cca_findcard2()