| /rk3399_rockchip-uboot/lib/rsa/ |
| H A D | rsa-verify.c | 91 const uint32_t sig_len, const uint32_t key_len, in rsa_mod_exp_hw() argument 100 if (key_len != RSA4096_BYTES) in rsa_mod_exp_hw() 105 if (key_len != RSA2048_BYTES) in rsa_mod_exp_hw() 110 rsa_key.n = malloc(key_len); in rsa_mod_exp_hw() 111 rsa_key.e = malloc(key_len); in rsa_mod_exp_hw() 112 rsa_key.c = malloc(key_len); in rsa_mod_exp_hw() 117 key_len, key_len); in rsa_mod_exp_hw() 119 key_len, key_len); in rsa_mod_exp_hw() 122 key_len, key_len); in rsa_mod_exp_hw() 125 key_len, key_len); in rsa_mod_exp_hw() [all …]
|
| H A D | rsa-sign.c | 728 int key_len, const char *csum_algo) in rsa_set_key_hash() argument 740 rsa_key = calloc(key_len * 3, sizeof(char)); in rsa_set_key_hash() 753 rsa_convert_big_endian(n, rsa_n, key_len, CONFIG_RSA_N_SIZE); in rsa_set_key_hash() 754 rsa_convert_big_endian(e, rsa_e, key_len, CONFIG_RSA_E_SIZE); in rsa_set_key_hash() 758 rsa_convert_big_endian(c, rsa_c, key_len, CONFIG_RSA_C_SIZE); in rsa_set_key_hash() 762 ret = calculate_hash(rsa_key, key_len * 3, csum_algo, value, &value_len); in rsa_set_key_hash() 774 rsa_convert_big_endian(np, rsa_np, key_len, CONFIG_RSA_C_SIZE); in rsa_set_key_hash() 950 ret = rsa_set_key_hash(keydest, node, info->crypto->key_len, in rsa_add_verify_data()
|
| /rk3399_rockchip-uboot/board/freescale/common/ |
| H A D | fsl_validate.c | 27 #define CHECK_KEY_LEN(key_len) (((key_len) == 2 * KEY_SIZE_BYTES / 4) || \ argument 28 ((key_len) == 2 * KEY_SIZE_BYTES / 2) || \ 29 ((key_len) == 2 * KEY_SIZE_BYTES)) 246 if (!CHECK_KEY_LEN(img->srk_tbl[i].key_len)) in read_validate_srk_tbl() 250 img->key_len = img->srk_tbl[key_num - 1].key_len; in read_validate_srk_tbl() 253 img->key_len); in read_validate_srk_tbl() 266 if (!CHECK_KEY_LEN(hdr->key_len)) in read_validate_single_key() 269 memcpy(&img->img_key, esbc + hdr->pkey, hdr->key_len); in read_validate_single_key() 271 img->key_len = hdr->key_len; in read_validate_single_key() 313 ie_key_len = ie_info->ie_key_tbl[ie_num - 1].key_len; in read_validate_ie_tbl() [all …]
|
| /rk3399_rockchip-uboot/drivers/crypto/rockchip/ |
| H A D | crypto_v2.c | 206 static inline void write_key_reg(u32 chn, const u8 *key, u32 key_len) in write_key_reg() argument 208 write_regs(CRYPTO_CH0_KEY_0 + chn * 0x10, key, key_len); in write_key_reg() 682 int rk_hmac_init(void *hw_ctx, u32 algo, u8 *key, u32 key_len) in rk_hmac_init() argument 687 if (!key || !key_len || key_len > 64) in rk_hmac_init() 692 write_key_reg(0, key, key_len); in rk_hmac_init() 705 sha_context *ctx, u8 *key, u32 key_len) in rockchip_crypto_hmac_init() argument 726 ret = rk_hmac_init(priv->hw_ctx, ctx->algo, key, key_len); in rockchip_crypto_hmac_init() 901 u32 key_len, const u8 *iv, u32 iv_len, in hw_cipher_init() argument 909 if (!key && key_len) in hw_cipher_init() 913 __func__, key, key_len, iv); in hw_cipher_init() [all …]
|
| H A D | rkce_core.c | 96 uint32_t algo, uint32_t mode, uint32_t key_len) in rk_is_cipher_support() argument 107 if (key_len == RKCE_DES_BLOCK_SIZE) in rk_is_cipher_support() 109 else if (key_len == 2 * RKCE_DES_BLOCK_SIZE || in rk_is_cipher_support() 110 key_len == 3 * RKCE_DES_BLOCK_SIZE) in rk_is_cipher_support() 118 if (key_len == RKCE_AES_KEYSIZE_128) in rk_is_cipher_support() 120 else if (key_len == RKCE_AES_KEYSIZE_192) in rk_is_cipher_support() 122 else if (key_len == RKCE_KEY_AES_256) in rk_is_cipher_support() 130 key_len_valid = (key_len == RKCE_SM4_KEYSIZE) ? true : false; in rk_is_cipher_support() 138 if (key_len == 0) in rk_is_cipher_support()
|
| H A D | crypto_ce.c | 276 u8 *key, u32 key_len, bool is_hmac) in rk_sha_init() argument 311 if (key_len > 64) { in rk_sha_init() 316 memcpy(hash_ctx->td_buf->key, key, key_len); in rk_sha_init() 422 static int rockchip_crypto_hmac_init(struct udevice *dev, sha_context *ctx, u8 *key, u32 key_len) in rockchip_crypto_hmac_init() argument 424 return rk_sha_init(dev, ctx, key, key_len, true); in rockchip_crypto_hmac_init() 689 u32 rk_get_td_keysize(u32 ce_algo, u32 ce_mode, u32 key_len) in rk_get_td_keysize() argument 694 if (key_len == AES_KEYSIZE_128) in rk_get_td_keysize() 696 else if (key_len == AES_KEYSIZE_192) in rk_get_td_keysize() 698 else if (key_len == AES_KEYSIZE_256) in rk_get_td_keysize() 714 memcpy(td_buf->key1, ctx->key, ctx->key_len); in rk_set_symm_td_buf_key() [all …]
|
| /rk3399_rockchip-uboot/include/ |
| H A D | fsl_validate.h | 110 u32 key_len; /* pub key length in bytes */ member 167 u32 key_len; member 180 u32 key_len; member 237 u32 key_len; member
|
| H A D | crypto.h | 86 u32 key_len; member 94 u32 key_len; member 119 u8 *key, u32 key_len); 256 u8 *key, u32 key_len);
|
| H A D | image.h | 1199 const int key_len; member
|
| /rk3399_rockchip-uboot/lib/avb/libavb/ |
| H A D | avb_cmdline.c | 136 size_t offset, key_len, value_len; in cmdline_append_option() local 139 key_len = avb_strlen(key); in cmdline_append_option() 150 new_cmdline = avb_calloc(offset + key_len + value_len + 2); in cmdline_append_option() 158 avb_memcpy(new_cmdline + offset, key, key_len); in cmdline_append_option() 159 new_cmdline[offset + key_len] = '='; in cmdline_append_option() 160 avb_memcpy(new_cmdline + offset + key_len + 1, value, value_len); in cmdline_append_option()
|
| /rk3399_rockchip-uboot/drivers/crypto/ |
| H A D | crypto-uclass.c | 203 u8 *key, u32 key_len) in crypto_hmac_init() argument 213 return ops->hmac_init(dev, ctx, key, key_len); in crypto_hmac_init() 315 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_cipher() 329 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_mac() 344 if (!ctx || !ctx->key || ctx->key_len == 0) in crypto_ae() 372 ctx->fw_keyid, ctx->key_len)) { in crypto_fw_cipher()
|
| /rk3399_rockchip-uboot/cmd/ |
| H A D | crypto.c | 30 u32 key_len; member 40 u32 key_len; member 108 .key_len = sizeof(hmac_key)\ 118 .key_len = sizeof(key1), \ 137 .key_len = sizeof(key_val), \ 320 const u8 *key, u32 key_len, ulong *MBps) in test_hash_perf() argument 346 ret = crypto_hmac_init(dev, &ctx, (u8 *)key, key_len); in test_hash_perf() 469 test_data->key_len); in test_hash_result() 491 test_data->key, test_data->key_len, &MBps); in test_hash_result() 536 ctx.key_len = test_data->key_len; in test_cipher_result()
|
| H A D | tpm.c | 600 uint32_t key_len, key_handle, err; in do_tpm_load_key_by_sha1() local 610 key_len = simple_strtoul(argv[3], NULL, 0); in do_tpm_load_key_by_sha1() 623 err = tpm_load_key2_oiap(parent_handle, key, key_len, usage_auth, in do_tpm_load_key_by_sha1() 637 uint32_t parent_handle, key_len, key_handle, err; in do_tpm_load_key2_oiap() local 646 key_len = simple_strtoul(argv[3], NULL, 0); in do_tpm_load_key2_oiap() 651 err = tpm_load_key2_oiap(parent_handle, key, key_len, usage_auth, in do_tpm_load_key2_oiap()
|
| /rk3399_rockchip-uboot/drivers/usb/gadget/ |
| H A D | f_rockusb.c | 603 uint32_t key_len = vhead->size - 9; in rkusb_do_vs_write() local 605 if (key_len == 4 && memcmp(data + 9, "lock", 4) == 0) { in rkusb_do_vs_write() 612 if (key_len != 16 && key_len != 24 && key_len != 32) { in rkusb_do_vs_write() 617 if (trusty_write_oem_otp_key(key_id, (uint8_t *)(data + 9), key_len) != 0) { in rkusb_do_vs_write() 624 uint32_t key_len = vhead->size - 9; in rkusb_do_vs_write() local 626 if (key_len == 4 && memcmp(data + 9, "lock", 4) == 0) { in rkusb_do_vs_write() 633 if (key_len != 16 && key_len != 32) { in rkusb_do_vs_write() 638 if (trusty_write_fw_encrypt_key(key_id, (uint8_t *)(data + 9), key_len) != 0) { in rkusb_do_vs_write()
|
| /rk3399_rockchip-uboot/fs/ubifs/ |
| H A D | misc.h | 194 return UBIFS_IDX_NODE_SZ + (UBIFS_BRANCH_SZ + c->key_len) * child_cnt; in ubifs_idx_node_sz() 209 (UBIFS_BRANCH_SZ + c->key_len) * bnum); in ubifs_idx_branch()
|
| H A D | sb.c | 87 c->key_len = UBIFS_SK_LEN; in create_default_filesystem() 599 c->key_len = UBIFS_SK_LEN; in ubifs_read_superblock()
|
| H A D | ubifs.h | 1920 int key_len; member
|
| /rk3399_rockchip-uboot/common/spl/ |
| H A D | spl_fit.c | 163 int key_len = 16; in spl_fit_image_uncipher() local 197 if (iv_len != key_len) { in spl_fit_image_uncipher() 199 iv_len, key_len, node_name); in spl_fit_image_uncipher() 207 ctx.key_len = key_len; in spl_fit_image_uncipher()
|
| /rk3399_rockchip-uboot/common/ |
| H A D | image-sig.c | 72 .key_len = RSA2048_BYTES, 79 .key_len = RSA4096_BYTES,
|
| H A D | image-fit.c | 1588 int key_len = 16; in fit_image_uncipher() local 1612 if (iv_len != key_len) { in fit_image_uncipher() 1614 iv_len, key_len, node_name); in fit_image_uncipher() 1622 config.key_len = key_len; in fit_image_uncipher() 1623 memcpy(config.iv, iv, key_len); in fit_image_uncipher()
|
| /rk3399_rockchip-uboot/include/optee_include/ |
| H A D | OpteeClientInterface.h | 67 uint32_t key_len; member
|
| /rk3399_rockchip-uboot/lib/optee_clientApi/ |
| H A D | OpteeClientInterface.c | 1151 if (config->key_len != 16 && in trusty_oem_otp_key_cipher() 1152 config->key_len != 24 && in trusty_oem_otp_key_cipher() 1153 config->key_len != 32) in trusty_oem_otp_key_cipher() 1156 if (key_id == RK_OEM_OTP_KEY_FW && config->key_len != 16) in trusty_oem_otp_key_cipher() 1160 if (config->key_len == 24) in trusty_oem_otp_key_cipher() 2266 if (config->key_len != 16 && in trusty_fw_key_cipher() 2267 config->key_len != 24 && in trusty_fw_key_cipher() 2268 config->key_len != 32) in trusty_fw_key_cipher()
|
| /rk3399_rockchip-uboot/lib/ |
| H A D | hashtable.c | 205 size_t key_len = strlen(match); in hmatch_r() local 210 if (!strncmp(match, htab->table[idx].entry.key, key_len)) { in hmatch_r()
|