Lines Matching +full:0 +full:xfffff0
78 ctx->enckey_dma_addr = 0; in cc_aead_exit()
92 xcbc->xcbc_keys_dma_addr = 0; in cc_aead_exit()
103 hmac->ipad_opad_dma_addr = 0; in cc_aead_exit()
112 hmac->padded_authkey_dma_addr = 0; in cc_aead_exit()
201 return 0; in cc_aead_init()
229 ctx->authsize) != 0) { in cc_aead_complete()
255 hw_desc_init(&desc[0]); in xcbc_setkey()
260 set_din_type(&desc[0], DMA_DLLI, in xcbc_setkey()
263 set_cipher_mode(&desc[0], DRV_CIPHER_ECB); in xcbc_setkey()
264 set_cipher_config0(&desc[0], DRV_CRYPTO_DIRECTION_ENCRYPT); in xcbc_setkey()
265 set_key_size_aes(&desc[0], ctx->auth_keylen); in xcbc_setkey()
266 set_flow_mode(&desc[0], S_DIN_to_AES); in xcbc_setkey()
267 set_setup_mode(&desc[0], SETUP_LOAD_KEY0); in xcbc_setkey()
270 set_din_const(&desc[1], 0x01010101, CC_AES_128_BIT_KEY_SIZE); in xcbc_setkey()
273 AES_KEYSIZE_128, NS_BIT, 0); in xcbc_setkey()
276 set_din_const(&desc[2], 0x02020202, CC_AES_128_BIT_KEY_SIZE); in xcbc_setkey()
280 AES_KEYSIZE_128, NS_BIT, 0); in xcbc_setkey()
283 set_din_const(&desc[3], 0x03030303, CC_AES_128_BIT_KEY_SIZE); in xcbc_setkey()
287 AES_KEYSIZE_128, NS_BIT, 0); in xcbc_setkey()
296 unsigned int digest_ofs = 0; in hmac_setkey()
303 unsigned int idx = 0; in hmac_setkey()
307 for (i = 0; i < 2; i++) { in hmac_setkey()
322 set_din_const(&desc[idx], 0, ctx->hash_len); in hmac_setkey()
350 digest_size, NS_BIT, 0); in hmac_setkey()
380 if (ctx->auth_keylen > 0) in validate_keys_sizes()
404 return 0; /* All tests of keys sizes passed */ in validate_keys_sizes()
413 dma_addr_t key_dma_addr = 0; in cc_get_plain_hmac_key()
421 unsigned int idx = 0; in cc_get_plain_hmac_key()
422 int rc = 0; in cc_get_plain_hmac_key()
428 switch (ctx->auth_mode) { /* auth_key required and >0 */ in cc_get_plain_hmac_key()
441 if (keylen != 0) { in cc_get_plain_hmac_key()
449 dev_err(dev, "Mapping key va=0x%p len=%u for DMA failed\n", in cc_get_plain_hmac_key()
468 set_din_const(&desc[idx], 0, ctx->hash_len); in cc_get_plain_hmac_key()
484 digestsize, NS_BIT, 0); in cc_get_plain_hmac_key()
493 set_din_const(&desc[idx], 0, (blocksize - digestsize)); in cc_get_plain_hmac_key()
497 NS_BIT, 0); in cc_get_plain_hmac_key()
505 keylen, NS_BIT, 0); in cc_get_plain_hmac_key()
508 if ((blocksize - keylen) != 0) { in cc_get_plain_hmac_key()
510 set_din_const(&desc[idx], 0, in cc_get_plain_hmac_key()
516 (blocksize - keylen), NS_BIT, 0); in cc_get_plain_hmac_key()
522 set_din_const(&desc[idx], 0, (blocksize - keylen)); in cc_get_plain_hmac_key()
525 blocksize, NS_BIT, 0); in cc_get_plain_hmac_key()
547 unsigned int seq_len = 0; in cc_aead_setkey()
585 ctx->auth_keylen = 0; in cc_aead_setkey()
597 memset(ctx->enckey + 24, 0, CC_AES_KEY_SIZE_MAX - 24); in cc_aead_setkey()
626 if (seq_len > 0) { /* For CCM there is no sequence to setup the key */ in cc_aead_setkey()
676 if (authsize == 0 || in cc_aead_setauthsize()
684 return 0; in cc_aead_setauthsize()
739 areq_ctx->cryptlen > 0) in cc_set_assoc_desc()
749 areq_ctx->cryptlen > 0) in cc_set_assoc_desc()
836 if (areq_ctx->cryptlen == 0) in cc_proc_cipher_desc()
850 areq_ctx->cryptlen, NS_BIT, 0); in cc_proc_cipher_desc()
859 areq_ctx->dst.mlli_nents, NS_BIT, 0); in cc_proc_cipher_desc()
972 if (req_ctx->cryptlen == 0) in cc_proc_cipher()
980 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_proc_cipher()
981 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_proc_cipher()
1030 set_din_const(&desc[idx], 0, CC_AES_BLOCK_SIZE); in cc_set_xcbc_desc()
1089 if (areq_ctx->assoclen > 0) in cc_proc_header_desc()
1359 return 0; in validate_data_size()
1367 unsigned int len = 0; in format_ccm_a0()
1369 if (header_size == 0) in format_ccm_a0()
1370 return 0; in format_ccm_a0()
1375 pa0_buff[0] = (header_size >> 8) & 0xFF; in format_ccm_a0()
1376 pa0_buff[1] = header_size & 0xFF; in format_ccm_a0()
1380 pa0_buff[0] = 0xFF; in format_ccm_a0()
1381 pa0_buff[1] = 0xFE; in format_ccm_a0()
1382 pa0_buff[2] = (header_size >> 24) & 0xFF; in format_ccm_a0()
1383 pa0_buff[3] = (header_size >> 16) & 0xFF; in format_ccm_a0()
1384 pa0_buff[4] = (header_size >> 8) & 0xFF; in format_ccm_a0()
1385 pa0_buff[5] = header_size & 0xFF; in format_ccm_a0()
1395 memset(block, 0, csize); in set_msg_len()
1406 return 0; in set_msg_len()
1476 if (req_ctx->assoclen > 0) { in cc_ccm()
1495 NS_BIT, 0); in cc_ccm()
1514 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_ccm()
1515 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_ccm()
1528 return 0; in cc_ccm()
1537 //unsigned int size_of_a = 0, rem_a_size = 0; in config_ccm_adata()
1538 unsigned int lp = req->iv[0]; in config_ccm_adata()
1539 /* Note: The code assume that req->iv[0] already contains the value in config_ccm_adata()
1553 memset(req_ctx->mac_buf, 0, AES_BLOCK_SIZE); in config_ccm_adata()
1554 memset(req_ctx->ccm_config, 0, AES_BLOCK_SIZE * 3); in config_ccm_adata()
1559 dev_dbg(dev, "illegal iv value %X\n", req->iv[0]); in config_ccm_adata()
1568 if (req_ctx->assoclen > 0) in config_ccm_adata()
1581 memset(req->iv + 15 - req->iv[0], 0, req->iv[0] + 1); in config_ccm_adata()
1585 ctr_count_0[15] = 0; in config_ccm_adata()
1587 return 0; in config_ccm_adata()
1597 memset(areq_ctx->ctr_iv, 0, AES_BLOCK_SIZE); in cc_proc_rfc4309_ccm()
1601 areq_ctx->ctr_iv[0] = 3; in cc_proc_rfc4309_ccm()
1634 set_din_const(&desc[idx], 0x0, AES_BLOCK_SIZE); in cc_set_ghash_desc()
1636 NS_BIT, 0); in cc_set_ghash_desc()
1642 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_set_ghash_desc()
1643 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_set_ghash_desc()
1650 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_set_ghash_desc()
1664 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_set_ghash_desc()
1665 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_set_ghash_desc()
1675 /* Load GHASH initial STATE (which is 0). (for any hash there is an in cc_set_ghash_desc()
1679 set_din_const(&desc[idx], 0x0, AES_BLOCK_SIZE); in cc_set_ghash_desc()
1680 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_set_ghash_desc()
1753 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_proc_gcm_result()
1755 NS_BIT, 0); in cc_proc_gcm_result()
1775 set_din_no_dma(&desc[idx], 0, 0xfffff0); in cc_proc_gcm_result()
1776 set_dout_no_dma(&desc[idx], 0, 0, 1); in cc_proc_gcm_result()
1806 return 0; in cc_gcm()
1818 if (req_ctx->assoclen > 0) in cc_gcm()
1826 return 0; in cc_gcm()
1845 memset(req_ctx->hkey, 0, AES_BLOCK_SIZE); in config_gcm_context()
1847 memset(req_ctx->mac_buf, 0, AES_BLOCK_SIZE); in config_gcm_context()
1871 temp64 = 0; in config_gcm_context()
1875 return 0; in config_gcm_context()
1894 int rc = 0; in cc_proc_aead()
1895 int seq_len = 0; in cc_proc_aead()
2025 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_aead_encrypt()
2049 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4309_ccm_encrypt()
2069 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_aead_decrypt()
2091 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4309_ccm_decrypt()
2203 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4106_gcm_encrypt()
2227 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4543_gcm_encrypt()
2254 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4106_gcm_decrypt()
2278 memset(areq_ctx, 0, sizeof(*areq_ctx)); in cc_rfc4543_gcm_decrypt()
2604 return 0; in cc_aead_free()
2633 for (alg = 0; alg < ARRAY_SIZE(aead_algs); alg++) { in cc_aead_alloc()
2658 return 0; in cc_aead_alloc()