| /linux-6.15/crypto/ |
| H A D | tea.c | 42 static int tea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in tea_setkey() argument 47 ctx->KEY[0] = get_unaligned_le32(&in_key[0]); in tea_setkey() 48 ctx->KEY[1] = get_unaligned_le32(&in_key[4]); in tea_setkey() 49 ctx->KEY[2] = get_unaligned_le32(&in_key[8]); in tea_setkey() 50 ctx->KEY[3] = get_unaligned_le32(&in_key[12]); in tea_setkey() 110 static int xtea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in xtea_setkey() argument 115 ctx->KEY[0] = get_unaligned_le32(&in_key[0]); in xtea_setkey() 116 ctx->KEY[1] = get_unaligned_le32(&in_key[4]); in xtea_setkey() 117 ctx->KEY[2] = get_unaligned_le32(&in_key[8]); in xtea_setkey() 118 ctx->KEY[3] = get_unaligned_le32(&in_key[12]); in xtea_setkey()
|
| H A D | aria_generic.c | 28 static void aria_set_encrypt_key(struct aria_ctx *ctx, const u8 *in_key, in aria_set_encrypt_key() argument 38 w0[0] = get_unaligned_be32(&in_key[0]); in aria_set_encrypt_key() 39 w0[1] = get_unaligned_be32(&in_key[4]); in aria_set_encrypt_key() 40 w0[2] = get_unaligned_be32(&in_key[8]); in aria_set_encrypt_key() 41 w0[3] = get_unaligned_be32(&in_key[12]); in aria_set_encrypt_key() 51 w1[0] = get_unaligned_be32(&in_key[16]); in aria_set_encrypt_key() 52 w1[1] = get_unaligned_be32(&in_key[20]); in aria_set_encrypt_key() 54 w1[2] = get_unaligned_be32(&in_key[24]); in aria_set_encrypt_key() 55 w1[3] = get_unaligned_be32(&in_key[28]); in aria_set_encrypt_key() 174 int aria_set_key(struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) in aria_set_key() argument [all …]
|
| H A D | seed.c | 327 static int seed_set_key(struct crypto_tfm *tfm, const u8 *in_key, in seed_set_key() argument 334 x1 = get_unaligned_be32(&in_key[0]); in seed_set_key() 335 x2 = get_unaligned_be32(&in_key[4]); in seed_set_key() 336 x3 = get_unaligned_be32(&in_key[8]); in seed_set_key() 337 x4 = get_unaligned_be32(&in_key[12]); in seed_set_key()
|
| H A D | sm4_generic.c | 31 static int sm4_setkey(struct crypto_tfm *tfm, const u8 *in_key, in sm4_setkey() argument 36 return sm4_expandkey(ctx, in_key, key_len); in sm4_setkey()
|
| H A D | aes_ti.c | 12 static int aesti_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aesti_set_key() argument 17 return aes_expandkey(ctx, in_key, key_len); in aesti_set_key()
|
| H A D | khazad.c | 756 static int khazad_setkey(struct crypto_tfm *tfm, const u8 *in_key, in khazad_setkey() argument 764 K2 = get_unaligned_be64(&in_key[0]); in khazad_setkey() 765 K1 = get_unaligned_be64(&in_key[8]); in khazad_setkey()
|
| H A D | arc4.c | 19 static int crypto_arc4_setkey(struct crypto_lskcipher *tfm, const u8 *in_key, in crypto_arc4_setkey() argument 24 return arc4_setkey(ctx, in_key, key_len); in crypto_arc4_setkey()
|
| /linux-6.15/arch/powerpc/crypto/ |
| H A D | aes-spe-glue.c | 100 ppc_expand_key_128(ctx->key_enc, in_key); in ppc_aes_setkey() 104 ppc_expand_key_192(ctx->key_enc, in_key); in ppc_aes_setkey() 108 ppc_expand_key_256(ctx->key_enc, in_key); in ppc_aes_setkey() 120 const u8 *in_key, unsigned int key_len) in ppc_aes_setkey_skcipher() argument 131 err = xts_verify_key(tfm, in_key, key_len); in ppc_xts_setkey() 140 ppc_expand_key_128(ctx->key_enc, in_key); in ppc_xts_setkey() 141 ppc_expand_key_128(ctx->key_twk, in_key + AES_KEYSIZE_128); in ppc_xts_setkey() 145 ppc_expand_key_192(ctx->key_enc, in_key); in ppc_xts_setkey() 146 ppc_expand_key_192(ctx->key_twk, in_key + AES_KEYSIZE_192); in ppc_xts_setkey() 150 ppc_expand_key_256(ctx->key_enc, in_key); in ppc_xts_setkey() [all …]
|
| /linux-6.15/drivers/crypto/nx/ |
| H A D | nx-aes-ctr.c | 23 const u8 *in_key, in ctr_aes_nx_set_key() argument 49 memcpy(csbcpb->cpb.aes_ctr.key, in_key, key_len); in ctr_aes_nx_set_key() 55 const u8 *in_key, in ctr3686_aes_nx_set_key() argument 64 in_key + key_len - CTR_RFC3686_NONCE_SIZE, in ctr3686_aes_nx_set_key() 69 return ctr_aes_nx_set_key(tfm, in_key, key_len); in ctr3686_aes_nx_set_key()
|
| H A D | nx-aes-ccm.c | 24 const u8 *in_key, in ccm_aes_nx_set_key() argument 44 memcpy(csbcpb->cpb.aes_ccm.key, in_key, key_len); in ccm_aes_nx_set_key() 47 memcpy(csbcpb_aead->cpb.aes_cca.key, in_key, key_len); in ccm_aes_nx_set_key() 54 const u8 *in_key, in ccm4309_aes_nx_set_key() argument 64 memcpy(nx_ctx->priv.ccm.nonce, in_key + key_len, 3); in ccm4309_aes_nx_set_key() 66 return ccm_aes_nx_set_key(tfm, in_key, key_len); in ccm4309_aes_nx_set_key()
|
| H A D | nx-aes-gcm.c | 24 const u8 *in_key, in gcm_aes_nx_set_key() argument 54 memcpy(csbcpb->cpb.aes_gcm.key, in_key, key_len); in gcm_aes_nx_set_key() 57 memcpy(csbcpb_aead->cpb.aes_gca.key, in_key, key_len); in gcm_aes_nx_set_key() 63 const u8 *in_key, in gcm4106_aes_nx_set_key() argument 75 rc = gcm_aes_nx_set_key(tfm, in_key, key_len); in gcm4106_aes_nx_set_key() 79 memcpy(nonce, in_key + key_len, 4); in gcm4106_aes_nx_set_key()
|
| H A D | nx-aes-ecb.c | 22 const u8 *in_key, in ecb_aes_nx_set_key() argument 48 memcpy(csbcpb->cpb.aes_ecb.key, in_key, key_len); in ecb_aes_nx_set_key()
|
| /linux-6.15/arch/s390/crypto/ |
| H A D | aes_s390.c | 102 return setkey_fallback_cip(tfm, in_key, key_len); in aes_set_key() 105 memcpy(sctx->key, in_key, key_len); in aes_set_key() 219 return setkey_fallback_skcipher(tfm, in_key, key_len); in ecb_aes_set_key() 222 memcpy(sctx->key, in_key, key_len); in ecb_aes_set_key() 318 memcpy(sctx->key, in_key, key_len); in cbc_aes_set_key() 401 err = xts_fallback_setkey(tfm, in_key, key_len); in xts_aes_set_key() 417 memcpy(xts_ctx->key, in_key, key_len); in xts_aes_set_key() 418 memcpy(xts_ctx->pcc_key, in_key + key_len, key_len); in xts_aes_set_key() 540 err = xts_fallback_setkey(tfm, in_key, key_len); in fullxts_aes_set_key() 554 memcpy(xts_ctx->keys, in_key, key_len); in fullxts_aes_set_key() [all …]
|
| H A D | paes_s390.c | 252 static int ecb_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key, in ecb_paes_set_key() argument 259 rc = _key_to_kb(&ctx->kb, in_key, key_len); in ecb_paes_set_key() 367 static int cbc_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key, in cbc_paes_set_key() argument 374 rc = _key_to_kb(&ctx->kb, in_key, key_len); in cbc_paes_set_key() 548 static int xts_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key, in xts_paes_set_key() argument 557 xts_verify_key(tfm, in_key, in_keylen)) in xts_paes_set_key() 561 rc = _xts_key_to_kb(&ctx->kb, in_key, in_keylen); in xts_paes_set_key() 780 static int ctr_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key, in ctr_paes_set_key() argument 787 rc = _key_to_kb(&ctx->kb, in_key, key_len); in ctr_paes_set_key()
|
| /linux-6.15/arch/arm/crypto/ |
| H A D | aes-neonbs-glue.c | 67 static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_setkey() argument 74 err = aes_expandkey(&rk, in_key, key_len); in aesbs_setkey() 126 static int aesbs_cbc_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_cbc_setkey() argument 132 err = aes_expandkey(&ctx->fallback, in_key, key_len); in aesbs_cbc_setkey() 203 static int aesbs_ctr_setkey_sync(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_ctr_setkey_sync() argument 209 err = aes_expandkey(&ctx->fallback, in_key, key_len); in aesbs_ctr_setkey_sync() 272 static int aesbs_xts_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_xts_setkey() argument 278 err = xts_verify_key(tfm, in_key, key_len); in aesbs_xts_setkey() 283 err = aes_expandkey(&ctx->fallback, in_key, key_len); in aesbs_xts_setkey() 286 err = aes_expandkey(&ctx->tweak_key, in_key + key_len, key_len); in aesbs_xts_setkey() [all …]
|
| H A D | aes-ce-glue.c | 69 static int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, in ce_aes_expandkey() argument 90 ctx->key_enc[i] = get_unaligned_le32(in_key + i * sizeof(u32)); in ce_aes_expandkey() 137 static int ce_aes_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in ce_aes_setkey() argument 142 return ce_aes_expandkey(ctx, in_key, key_len); in ce_aes_setkey() 150 static int xts_set_key(struct crypto_skcipher *tfm, const u8 *in_key, in xts_set_key() argument 156 ret = xts_verify_key(tfm, in_key, key_len); in xts_set_key() 160 ret = ce_aes_expandkey(&ctx->key1, in_key, key_len / 2); in xts_set_key() 162 ret = ce_aes_expandkey(&ctx->key2, &in_key[key_len / 2], in xts_set_key()
|
| /linux-6.15/arch/arm64/crypto/ |
| H A D | aes-ce-setkey.h | 3 int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, 5 int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key,
|
| H A D | aes-ce-glue.c | 74 int ce_aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, in ce_aes_expandkey() argument 95 ctx->key_enc[i] = get_unaligned_le32(in_key + i * sizeof(u32)); in ce_aes_expandkey() 142 int ce_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key, in ce_aes_setkey() argument 147 return ce_aes_expandkey(ctx, in_key, key_len); in ce_aes_setkey()
|
| H A D | aes-neonbs-glue.c | 75 static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_setkey() argument 82 err = aes_expandkey(&rk, in_key, key_len); in aesbs_setkey() 134 static int aesbs_cbc_ctr_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_cbc_ctr_setkey() argument 141 err = aes_expandkey(&rk, in_key, key_len); in aesbs_cbc_ctr_setkey() 252 static int aesbs_xts_setkey(struct crypto_skcipher *tfm, const u8 *in_key, in aesbs_xts_setkey() argument 259 err = xts_verify_key(tfm, in_key, key_len); in aesbs_xts_setkey() 264 err = aes_expandkey(&ctx->cts, in_key, key_len); in aesbs_xts_setkey() 268 err = aes_expandkey(&rk, in_key + key_len, key_len); in aesbs_xts_setkey() 274 return aesbs_setkey(tfm, in_key, key_len); in aesbs_xts_setkey()
|
| H A D | aes-glue.c | 142 return aes_expandkey(ctx, in_key, key_len); in skcipher_aes_setkey() 146 const u8 *in_key, unsigned int key_len) in xts_set_key() argument 151 ret = xts_verify_key(tfm, in_key, key_len); in xts_set_key() 155 ret = aes_expandkey(&ctx->key1, in_key, key_len / 2); in xts_set_key() 157 ret = aes_expandkey(&ctx->key2, &in_key[key_len / 2], in xts_set_key() 163 const u8 *in_key, in essiv_cbc_set_key() argument 170 ret = aes_expandkey(&ctx->key1, in_key, key_len); in essiv_cbc_set_key() 174 crypto_shash_tfm_digest(ctx->hash, in_key, key_len, digest); in essiv_cbc_set_key() 805 return aes_expandkey(&ctx->key, in_key, key_len); in cbcmac_setkey() 825 err = cbcmac_setkey(tfm, in_key, key_len); in cmac_setkey() [all …]
|
| /linux-6.15/arch/sparc/crypto/ |
| H A D | camellia_glue.c | 34 extern void camellia_sparc64_key_expand(const u32 *in_key, u64 *encrypt_key, 41 const u32 *in_key = (const u32 *) _in_key; in camellia_set_key() local 48 camellia_sparc64_key_expand(in_key, &ctx->encrypt_key[0], in camellia_set_key() 54 const u8 *in_key, unsigned int key_len) in camellia_set_key_skcipher() argument 56 return camellia_set_key(crypto_skcipher_tfm(tfm), in_key, key_len); in camellia_set_key_skcipher()
|
| /linux-6.15/drivers/crypto/intel/keembay/ |
| H A D | keembay-ocs-aes-core.c | 148 if (!in_key) in check_key() 170 ret = check_key(in_key, key_len, cipher); in save_key() 174 memcpy(tctx->key, in_key, key_len); in save_key() 192 return save_key(tctx, in_key, key_len, cipher); in kmb_ocs_sk_set_key() 200 return crypto_sync_skcipher_setkey(tctx->sw_cipher.sk, in_key, key_len); in kmb_ocs_sk_set_key() 214 return save_key(tctx, in_key, key_len, cipher); in kmb_ocs_aead_set_key() 220 return crypto_aead_setkey(tctx->sw_cipher.aead, in_key, key_len); in kmb_ocs_aead_set_key() 999 return kmb_ocs_sk_set_key(tfm, in_key, key_len, OCS_AES); in kmb_ocs_aes_set_key() 1005 return kmb_ocs_aead_set_key(tfm, in_key, key_len, OCS_AES); in kmb_ocs_aes_aead_set_key() 1075 return kmb_ocs_sk_set_key(tfm, in_key, key_len, OCS_SM4); in kmb_ocs_sm4_set_key() [all …]
|
| /linux-6.15/include/crypto/ |
| H A D | aes.h | 51 int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, 68 int aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key,
|
| /linux-6.15/fs/smb/common/ |
| H A D | cifs_arc4.c | 16 int cifs_arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len) in cifs_arc4_setkey() argument 29 j = (j + in_key[k] + a) & 0xff; in cifs_arc4_setkey()
|
| /linux-6.15/lib/crypto/ |
| H A D | arc4.c | 13 int arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len) in arc4_setkey() argument 26 j = (j + in_key[k] + a) & 0xff; in arc4_setkey()
|