Lines Matching refs:keylen
123 unsigned int keylen, in crypto4xx_setkey_aes() argument
131 if (keylen != AES_KEYSIZE_256 && keylen != AES_KEYSIZE_192 && in crypto4xx_setkey_aes()
132 keylen != AES_KEYSIZE_128) in crypto4xx_setkey_aes()
139 rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4); in crypto4xx_setkey_aes()
161 key, keylen); in crypto4xx_setkey_aes()
162 sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); in crypto4xx_setkey_aes()
163 sa->sa_command_1.bf.key_len = keylen >> 3; in crypto4xx_setkey_aes()
178 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_cbc() argument
180 return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CBC, in crypto4xx_setkey_aes_cbc()
185 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_cfb() argument
187 return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CFB, in crypto4xx_setkey_aes_cfb()
192 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_ecb() argument
194 return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_ECB, in crypto4xx_setkey_aes_ecb()
199 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_ofb() argument
201 return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_OFB, in crypto4xx_setkey_aes_ofb()
206 const u8 *key, unsigned int keylen) in crypto4xx_setkey_rfc3686() argument
211 rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE, in crypto4xx_setkey_rfc3686()
216 ctx->iv_nonce = cpu_to_le32p((u32 *)&key[keylen - in crypto4xx_setkey_rfc3686()
290 unsigned int keylen) in crypto4xx_sk_setup_fallback() argument
296 return crypto_sync_skcipher_setkey(ctx->sw_cipher.cipher, key, keylen); in crypto4xx_sk_setup_fallback()
300 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_ctr() argument
305 rc = crypto4xx_sk_setup_fallback(ctx, cipher, key, keylen); in crypto4xx_setkey_aes_ctr()
309 return crypto4xx_setkey_aes(cipher, key, keylen, in crypto4xx_setkey_aes_ctr()
369 unsigned int keylen) in crypto4xx_aead_setup_fallback() argument
374 return crypto_aead_setkey(ctx->sw_cipher.aead, key, keylen); in crypto4xx_aead_setup_fallback()
382 unsigned int keylen) in crypto4xx_setkey_aes_ccm() argument
389 rc = crypto4xx_aead_setup_fallback(ctx, cipher, key, keylen); in crypto4xx_setkey_aes_ccm()
396 rc = crypto4xx_alloc_sa(ctx, SA_AES128_CCM_LEN + (keylen - 16) / 4); in crypto4xx_setkey_aes_ccm()
402 sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); in crypto4xx_setkey_aes_ccm()
417 sa->sa_command_1.bf.key_len = keylen >> 3; in crypto4xx_setkey_aes_ccm()
419 crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), key, keylen); in crypto4xx_setkey_aes_ccm()
437 sa->sa_command_1.bf.key_len = keylen >> 3; in crypto4xx_setkey_aes_ccm()
496 static int crypto4xx_aes_gcm_validate_keylen(unsigned int keylen) in crypto4xx_aes_gcm_validate_keylen() argument
498 switch (keylen) { in crypto4xx_aes_gcm_validate_keylen()
509 unsigned int keylen) in crypto4xx_compute_gcm_hash_key_sw() argument
515 rc = aes_expandkey(&ctx, key, keylen); in crypto4xx_compute_gcm_hash_key_sw()
528 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_gcm() argument
535 if (crypto4xx_aes_gcm_validate_keylen(keylen) != 0) in crypto4xx_setkey_aes_gcm()
538 rc = crypto4xx_aead_setup_fallback(ctx, cipher, key, keylen); in crypto4xx_setkey_aes_gcm()
545 rc = crypto4xx_alloc_sa(ctx, SA_AES128_GCM_LEN + (keylen - 16) / 4); in crypto4xx_setkey_aes_gcm()
551 sa->sa_contents.w = SA_AES_GCM_CONTENTS | (keylen << 2); in crypto4xx_setkey_aes_gcm()
564 sa->sa_command_1.bf.key_len = keylen >> 3; in crypto4xx_setkey_aes_gcm()
567 key, keylen); in crypto4xx_setkey_aes_gcm()
570 key, keylen); in crypto4xx_setkey_aes_gcm()