Lines Matching refs:key_sz

120 	unsigned int key_sz;  member
267 shift = ctx->key_sz - len; in hpre_prepare_dma_buf()
271 ptr = dma_alloc_coherent(dev, ctx->key_sz, tmp, GFP_ATOMIC); in hpre_prepare_dma_buf()
295 if ((sg_is_last(data) && len == ctx->key_sz) && in hpre_hw_data_init()
327 dma_free_coherent(dev, ctx->key_sz, req->src, tmp); in hpre_hw_data_clr_all()
329 dma_unmap_single(dev, tmp, ctx->key_sz, DMA_TO_DEVICE); in hpre_hw_data_clr_all()
339 ctx->key_sz, 1); in hpre_hw_data_clr_all()
340 dma_free_coherent(dev, ctx->key_sz, req->dst, tmp); in hpre_hw_data_clr_all()
342 dma_unmap_single(dev, tmp, ctx->key_sz, DMA_FROM_DEVICE); in hpre_hw_data_clr_all()
395 ctx->key_sz = 0; in hpre_ctx_set()
411 ctx->key_sz = 0; in hpre_ctx_clear()
442 areq->dst_len = ctx->key_sz; in hpre_dh_cb()
468 areq->dst_len = ctx->key_sz; in hpre_rsa_cb()
524 if (akreq->dst_len < ctx->key_sz) { in hpre_msg_request_set()
525 akreq->dst_len = ctx->key_sz; in hpre_msg_request_set()
538 if (kreq->dst_len < ctx->key_sz) { in hpre_msg_request_set()
539 kreq->dst_len = ctx->key_sz; in hpre_msg_request_set()
555 msg->task_len1 = (ctx->key_sz >> HPRE_BITS_2_BYTES_SHIFT) - 1; in hpre_msg_request_set()
632 static int hpre_is_dh_params_length_valid(unsigned int key_sz) in hpre_is_dh_params_length_valid() argument
640 switch (key_sz) { in hpre_is_dh_params_length_valid()
665 sz = ctx->key_sz = params->p_size; in hpre_dh_set_params()
695 unsigned int sz = ctx->key_sz; in hpre_dh_clear_ctx()
732 memcpy(ctx->dh.xa_p + (ctx->key_sz - params.key_size), params.key, in hpre_dh_set_secret()
746 return ctx->key_sz; in hpre_dh_max_size()
803 if (ctx->key_sz == HPRE_RSA_512BITS_KSZ || in hpre_rsa_enc()
804 ctx->key_sz == HPRE_RSA_1536BITS_KSZ) { in hpre_rsa_enc()
851 if (ctx->key_sz == HPRE_RSA_512BITS_KSZ || in hpre_rsa_dec()
852 ctx->key_sz == HPRE_RSA_1536BITS_KSZ) { in hpre_rsa_dec()
903 ctx->key_sz = vlen; in hpre_rsa_set_n()
906 if (!hpre_rsa_key_size_is_support(ctx->key_sz)) in hpre_rsa_set_n()
941 if (!ctx->key_sz || !vlen || vlen > ctx->key_sz) in hpre_rsa_set_e()
944 memcpy(ctx->rsa.pubkey + ctx->key_sz - vlen, ptr, vlen); in hpre_rsa_set_e()
956 if (!ctx->key_sz || !vlen || vlen > ctx->key_sz) in hpre_rsa_set_d()
959 memcpy(ctx->rsa.prikey + ctx->key_sz - vlen, ptr, vlen); in hpre_rsa_set_d()
981 unsigned int hlf_ksz = ctx->key_sz >> 1; in hpre_rsa_setkey_crt()
1039 unsigned int half_key_sz = ctx->key_sz >> 1; in hpre_rsa_clear_ctx()
1046 dma_free_coherent(dev, ctx->key_sz << 1, in hpre_rsa_clear_ctx()
1060 memzero_explicit(ctx->rsa.prikey, ctx->key_sz); in hpre_rsa_clear_ctx()
1061 dma_free_coherent(dev, ctx->key_sz << 1, ctx->rsa.prikey, in hpre_rsa_clear_ctx()
1162 if (ctx->key_sz == HPRE_RSA_512BITS_KSZ || in hpre_rsa_max_size()
1163 ctx->key_sz == HPRE_RSA_1536BITS_KSZ) in hpre_rsa_max_size()
1166 return ctx->key_sz; in hpre_rsa_max_size()
1212 unsigned int sz = ctx->key_sz; in hpre_ecc_clear_ctx()
1273 unsigned int shifta = ctx->key_sz << 1; in hpre_ecdh_fill_curve()
1274 unsigned int shiftb = ctx->key_sz << 2; in hpre_ecdh_fill_curve()
1275 void *p = ctx->ecdh.p + ctx->key_sz - cur_sz; in hpre_ecdh_fill_curve()
1278 void *x = ctx->ecdh.g + ctx->key_sz - cur_sz; in hpre_ecdh_fill_curve()
1286 n = kzalloc(ctx->key_sz, GFP_KERNEL); in hpre_ecdh_fill_curve()
1328 ctx->key_sz = hpre_ecdh_supported_curve(ctx->curve_id); in hpre_ecdh_set_param()
1329 if (!ctx->key_sz) in hpre_ecdh_set_param()
1336 sz = ctx->key_sz; in hpre_ecdh_set_param()
1360 static bool hpre_key_is_zero(char *key, unsigned short key_sz) in hpre_key_is_zero() argument
1364 for (i = 0; i < key_sz; i++) in hpre_key_is_zero()
1428 sz = ctx->key_sz; in hpre_ecdh_set_secret()
1449 dma_free_coherent(dev, ctx->key_sz << 2, req->src, dma); in hpre_ecdh_hw_data_clr_all()
1456 dma_free_coherent(dev, ctx->key_sz << 1, req->dst, dma); in hpre_ecdh_hw_data_clr_all()
1458 dma_unmap_single(dev, dma, ctx->key_sz << 1, DMA_FROM_DEVICE); in hpre_ecdh_hw_data_clr_all()
1473 areq->dst_len = ctx->key_sz << 1; in hpre_ecdh_cb()
1480 memmove(p, p + ctx->key_sz - curve_sz, curve_sz); in hpre_ecdh_cb()
1497 if (req->dst_len < ctx->key_sz << 1) { in hpre_ecdh_msg_request_set()
1498 req->dst_len = ctx->key_sz << 1; in hpre_ecdh_msg_request_set()
1513 msg->task_len1 = (ctx->key_sz >> HPRE_BITS_2_BYTES_SHIFT) - 1; in hpre_ecdh_msg_request_set()
1536 shift = ctx->key_sz - (len >> 1); in hpre_ecdh_src_data_init()
1540 ptr = dma_alloc_coherent(dev, ctx->key_sz << 2, &dma, GFP_KERNEL); in hpre_ecdh_src_data_init()
1544 tmpshift = ctx->key_sz << 1; in hpre_ecdh_src_data_init()
1547 memcpy(ptr + ctx->key_sz + shift, ptr + tmpshift + (len >> 1), len >> 1); in hpre_ecdh_src_data_init()
1562 if (unlikely(!data || !sg_is_last(data) || len != ctx->key_sz << 1)) { in hpre_ecdh_dst_data_init()
1626 return ctx->key_sz << 1; in hpre_ecdh_max_size()
1673 unsigned int sz = ctx->key_sz; in hpre_curve25519_fill_curve()
1704 unsigned int sz = ctx->key_sz; in hpre_curve25519_set_param()
1740 ctx->key_sz = CURVE25519_KEY_SIZE; in hpre_curve25519_set_secret()
1765 dma_free_coherent(dev, ctx->key_sz, req->src, dma); in hpre_curve25519_hw_data_clr_all()
1772 dma_free_coherent(dev, ctx->key_sz, req->dst, dma); in hpre_curve25519_hw_data_clr_all()
1774 dma_unmap_single(dev, dma, ctx->key_sz, DMA_FROM_DEVICE); in hpre_curve25519_hw_data_clr_all()
1787 areq->dst_len = ctx->key_sz; in hpre_curve25519_cb()
1809 if (unlikely(req->dst_len < ctx->key_sz)) { in hpre_curve25519_msg_request_set()
1810 req->dst_len = ctx->key_sz; in hpre_curve25519_msg_request_set()
1825 msg->task_len1 = (ctx->key_sz >> HPRE_BITS_2_BYTES_SHIFT) - 1; in hpre_curve25519_msg_request_set()
1863 ptr = dma_alloc_coherent(dev, ctx->key_sz, &dma, GFP_KERNEL); in hpre_curve25519_src_init()
1890 if (memcmp(ptr, p, ctx->key_sz) == 0) { in hpre_curve25519_src_init()
1893 } else if (memcmp(ptr, p, ctx->key_sz) > 0) { in hpre_curve25519_src_init()
1902 dma_free_coherent(dev, ctx->key_sz, ptr, dma); in hpre_curve25519_src_init()
1914 if (!data || !sg_is_last(data) || len != ctx->key_sz) { in hpre_curve25519_dst_init()
1978 return ctx->key_sz; in hpre_curve25519_max_size()