/crypto/ |
D | shash.c | 73 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() argument 76 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() 90 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned() 94 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned() 97 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument 100 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() 105 return shash_update_unaligned(desc, data, len); in crypto_shash_update() 107 return shash->update(desc, data, len); in crypto_shash_update() 111 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument 113 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() [all …]
|
D | hmac.c | 58 } desc; in hmac_setkey() local 61 desc.shash.tfm = hash; in hmac_setkey() 62 desc.shash.flags = crypto_shash_get_flags(parent) & in hmac_setkey() 68 err = crypto_shash_digest(&desc.shash, inkey, keylen, ipad); in hmac_setkey() 84 return crypto_shash_init(&desc.shash) ?: in hmac_setkey() 85 crypto_shash_update(&desc.shash, ipad, bs) ?: in hmac_setkey() 86 crypto_shash_export(&desc.shash, ipad) ?: in hmac_setkey() 87 crypto_shash_init(&desc.shash) ?: in hmac_setkey() 88 crypto_shash_update(&desc.shash, opad, bs) ?: in hmac_setkey() 89 crypto_shash_export(&desc.shash, opad); in hmac_setkey() [all …]
|
D | cts.c | 74 struct blkcipher_desc *desc, in cts_cbc_encrypt() argument 80 int bsize = crypto_blkcipher_blocksize(desc->tfm); in cts_cbc_encrypt() 98 memcpy(iv, desc->info, bsize); in cts_cbc_encrypt() 102 lcldesc.flags = desc->flags; in cts_cbc_encrypt() 120 memcpy(desc->info, tmp2, bsize); in cts_cbc_encrypt() 125 static int crypto_cts_encrypt(struct blkcipher_desc *desc, in crypto_cts_encrypt() argument 129 struct crypto_cts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in crypto_cts_encrypt() 130 int bsize = crypto_blkcipher_blocksize(desc->tfm); in crypto_cts_encrypt() 137 lcldesc.info = desc->info; in crypto_cts_encrypt() 138 lcldesc.flags = desc->flags; in crypto_cts_encrypt() [all …]
|
D | ablk_helper.c | 58 struct blkcipher_desc desc; in __ablk_encrypt() local 60 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm); in __ablk_encrypt() 61 desc.info = req->info; in __ablk_encrypt() 62 desc.flags = 0; in __ablk_encrypt() 64 return crypto_blkcipher_crt(desc.tfm)->encrypt( in __ablk_encrypt() 65 &desc, req->dst, req->src, req->nbytes); in __ablk_encrypt() 102 struct blkcipher_desc desc; in ablk_decrypt() local 104 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm); in ablk_decrypt() 105 desc.info = req->info; in ablk_decrypt() 106 desc.flags = 0; in ablk_decrypt() [all …]
|
D | sha1_generic.c | 28 static int sha1_init(struct shash_desc *desc) in sha1_init() argument 30 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_init() 39 int crypto_sha1_update(struct shash_desc *desc, const u8 *data, in crypto_sha1_update() argument 42 struct sha1_state *sctx = shash_desc_ctx(desc); in crypto_sha1_update() 78 static int sha1_final(struct shash_desc *desc, u8 *out) in sha1_final() argument 80 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_final() 91 crypto_sha1_update(desc, padding, padlen); in sha1_final() 94 crypto_sha1_update(desc, (const u8 *)&bits, sizeof(bits)); in sha1_final() 106 static int sha1_export(struct shash_desc *desc, void *out) in sha1_export() argument 108 struct sha1_state *sctx = shash_desc_ctx(desc); in sha1_export() [all …]
|
D | crc32.c | 76 static int crc32_init(struct shash_desc *desc) in crc32_init() argument 78 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_init() 79 u32 *crcp = shash_desc_ctx(desc); in crc32_init() 86 static int crc32_update(struct shash_desc *desc, const u8 *data, in crc32_update() argument 89 u32 *crcp = shash_desc_ctx(desc); in crc32_update() 103 static int crc32_finup(struct shash_desc *desc, const u8 *data, in crc32_finup() argument 106 return __crc32_finup(shash_desc_ctx(desc), data, len, out); in crc32_finup() 109 static int crc32_final(struct shash_desc *desc, u8 *out) in crc32_final() argument 111 u32 *crcp = shash_desc_ctx(desc); in crc32_final() 117 static int crc32_digest(struct shash_desc *desc, const u8 *data, in crc32_digest() argument [all …]
|
D | crc32c.c | 61 static int chksum_init(struct shash_desc *desc) in chksum_init() argument 63 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_init() 64 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_init() 89 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument 92 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update() 98 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument 100 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final() 112 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument 115 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup() 120 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument [all …]
|
D | blkcipher.c | 39 static int blkcipher_walk_next(struct blkcipher_desc *desc, 41 static int blkcipher_walk_first(struct blkcipher_desc *desc, 103 int blkcipher_walk_done(struct blkcipher_desc *desc, in blkcipher_walk_done() argument 131 crypto_yield(desc->flags); in blkcipher_walk_done() 132 return blkcipher_walk_next(desc, walk); in blkcipher_walk_done() 135 if (walk->iv != desc->info) in blkcipher_walk_done() 136 memcpy(desc->info, walk->iv, walk->ivsize); in blkcipher_walk_done() 146 static inline int blkcipher_next_slow(struct blkcipher_desc *desc, in blkcipher_next_slow() argument 165 return blkcipher_walk_done(desc, walk, -ENOMEM); in blkcipher_next_slow() 196 static inline int blkcipher_next_fast(struct blkcipher_desc *desc, in blkcipher_next_fast() argument [all …]
|
D | md5.c | 50 static int md5_init(struct shash_desc *desc) in md5_init() argument 52 struct md5_state *mctx = shash_desc_ctx(desc); in md5_init() 63 static int md5_update(struct shash_desc *desc, const u8 *data, unsigned int len) in md5_update() argument 65 struct md5_state *mctx = shash_desc_ctx(desc); in md5_update() 95 static int md5_final(struct shash_desc *desc, u8 *out) in md5_final() argument 97 struct md5_state *mctx = shash_desc_ctx(desc); in md5_final() 123 static int md5_export(struct shash_desc *desc, void *out) in md5_export() argument 125 struct md5_state *ctx = shash_desc_ctx(desc); in md5_export() 131 static int md5_import(struct shash_desc *desc, const void *in) in md5_import() argument 133 struct md5_state *ctx = shash_desc_ctx(desc); in md5_import()
|
D | pcbc.c | 45 static int crypto_pcbc_encrypt_segment(struct blkcipher_desc *desc, in crypto_pcbc_encrypt_segment() argument 70 static int crypto_pcbc_encrypt_inplace(struct blkcipher_desc *desc, in crypto_pcbc_encrypt_inplace() argument 97 static int crypto_pcbc_encrypt(struct blkcipher_desc *desc, in crypto_pcbc_encrypt() argument 102 struct crypto_blkcipher *tfm = desc->tfm; in crypto_pcbc_encrypt() 108 err = blkcipher_walk_virt(desc, &walk); in crypto_pcbc_encrypt() 112 nbytes = crypto_pcbc_encrypt_inplace(desc, &walk, in crypto_pcbc_encrypt() 115 nbytes = crypto_pcbc_encrypt_segment(desc, &walk, in crypto_pcbc_encrypt() 117 err = blkcipher_walk_done(desc, &walk, nbytes); in crypto_pcbc_encrypt() 123 static int crypto_pcbc_decrypt_segment(struct blkcipher_desc *desc, in crypto_pcbc_decrypt_segment() argument 150 static int crypto_pcbc_decrypt_inplace(struct blkcipher_desc *desc, in crypto_pcbc_decrypt_inplace() argument [all …]
|
D | cbc.c | 42 static int crypto_cbc_encrypt_segment(struct blkcipher_desc *desc, in crypto_cbc_encrypt_segment() argument 66 static int crypto_cbc_encrypt_inplace(struct blkcipher_desc *desc, in crypto_cbc_encrypt_inplace() argument 90 static int crypto_cbc_encrypt(struct blkcipher_desc *desc, in crypto_cbc_encrypt() argument 95 struct crypto_blkcipher *tfm = desc->tfm; in crypto_cbc_encrypt() 101 err = blkcipher_walk_virt(desc, &walk); in crypto_cbc_encrypt() 105 nbytes = crypto_cbc_encrypt_inplace(desc, &walk, child); in crypto_cbc_encrypt() 107 nbytes = crypto_cbc_encrypt_segment(desc, &walk, child); in crypto_cbc_encrypt() 108 err = blkcipher_walk_done(desc, &walk, nbytes); in crypto_cbc_encrypt() 114 static int crypto_cbc_decrypt_segment(struct blkcipher_desc *desc, in crypto_cbc_decrypt_segment() argument 140 static int crypto_cbc_decrypt_inplace(struct blkcipher_desc *desc, in crypto_cbc_decrypt_inplace() argument [all …]
|
D | ghash-generic.c | 35 static int ghash_init(struct shash_desc *desc) in ghash_init() argument 37 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_init() 63 static int ghash_update(struct shash_desc *desc, in ghash_update() argument 66 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_update() 67 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update() 119 static int ghash_final(struct shash_desc *desc, u8 *dst) in ghash_final() argument 121 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_final() 122 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
|
D | tgr192.c | 498 static int tgr192_init(struct shash_desc *desc) in tgr192_init() argument 500 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_init() 514 static int tgr192_update(struct shash_desc *desc, const u8 *inbuf, in tgr192_update() argument 517 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_update() 531 tgr192_update(desc, NULL, 0); in tgr192_update() 555 static int tgr192_final(struct shash_desc *desc, u8 * out) in tgr192_final() argument 557 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_final() 563 tgr192_update(desc, NULL, 0); /* flush */ ; in tgr192_final() 591 tgr192_update(desc, NULL, 0); /* flush */ ; in tgr192_final() 609 static int tgr160_final(struct shash_desc *desc, u8 * out) in tgr160_final() argument [all …]
|
D | ecb.c | 41 static int crypto_ecb_crypt(struct blkcipher_desc *desc, in crypto_ecb_crypt() argument 50 err = blkcipher_walk_virt(desc, walk); in crypto_ecb_crypt() 63 err = blkcipher_walk_done(desc, walk, nbytes); in crypto_ecb_crypt() 69 static int crypto_ecb_encrypt(struct blkcipher_desc *desc, in crypto_ecb_encrypt() argument 74 struct crypto_blkcipher *tfm = desc->tfm; in crypto_ecb_encrypt() 79 return crypto_ecb_crypt(desc, &walk, child, in crypto_ecb_encrypt() 83 static int crypto_ecb_decrypt(struct blkcipher_desc *desc, in crypto_ecb_decrypt() argument 88 struct crypto_blkcipher *tfm = desc->tfm; in crypto_ecb_decrypt() 93 return crypto_ecb_crypt(desc, &walk, child, in crypto_ecb_decrypt()
|
D | crypto_null.c | 42 static int null_init(struct shash_desc *desc) in null_init() argument 47 static int null_update(struct shash_desc *desc, const u8 *data, in null_update() argument 53 static int null_final(struct shash_desc *desc, u8 *out) in null_final() argument 58 static int null_digest(struct shash_desc *desc, const u8 *data, in null_digest() argument 77 static int skcipher_null_crypt(struct blkcipher_desc *desc, in skcipher_null_crypt() argument 85 err = blkcipher_walk_virt(desc, &walk); in skcipher_null_crypt() 91 err = blkcipher_walk_done(desc, &walk, 0); in skcipher_null_crypt()
|
D | sha512_generic.c | 133 sha512_init(struct shash_desc *desc) in sha512_init() argument 135 struct sha512_state *sctx = shash_desc_ctx(desc); in sha512_init() 150 sha384_init(struct shash_desc *desc) in sha384_init() argument 152 struct sha512_state *sctx = shash_desc_ctx(desc); in sha384_init() 166 int crypto_sha512_update(struct shash_desc *desc, const u8 *data, in crypto_sha512_update() argument 169 struct sha512_state *sctx = shash_desc_ctx(desc); in crypto_sha512_update() 203 sha512_final(struct shash_desc *desc, u8 *hash) in sha512_final() argument 205 struct sha512_state *sctx = shash_desc_ctx(desc); in sha512_final() 219 crypto_sha512_update(desc, padding, pad_len); in sha512_final() 222 crypto_sha512_update(desc, (const u8 *)bits, sizeof(bits)); in sha512_final() [all …]
|
D | michael_mic.c | 50 static int michael_init(struct shash_desc *desc) in michael_init() argument 52 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_init() 53 struct michael_mic_ctx *ctx = crypto_shash_ctx(desc->tfm); in michael_init() 62 static int michael_update(struct shash_desc *desc, const u8 *data, in michael_update() argument 65 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_update() 103 static int michael_final(struct shash_desc *desc, u8 *out) in michael_final() argument 105 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_final()
|
D | tcrypt.c | 70 static int test_cipher_jiffies(struct blkcipher_desc *desc, int enc, in test_cipher_jiffies() argument 80 ret = crypto_blkcipher_encrypt(desc, sg, sg, blen); in test_cipher_jiffies() 82 ret = crypto_blkcipher_decrypt(desc, sg, sg, blen); in test_cipher_jiffies() 93 static int test_cipher_cycles(struct blkcipher_desc *desc, int enc, in test_cipher_cycles() argument 105 ret = crypto_blkcipher_encrypt(desc, sg, sg, blen); in test_cipher_cycles() 107 ret = crypto_blkcipher_decrypt(desc, sg, sg, blen); in test_cipher_cycles() 119 ret = crypto_blkcipher_encrypt(desc, sg, sg, blen); in test_cipher_cycles() 121 ret = crypto_blkcipher_decrypt(desc, sg, sg, blen); in test_cipher_cycles() 150 struct blkcipher_desc desc; in test_cipher_speed() local 168 desc.tfm = tfm; in test_cipher_speed() [all …]
|
D | cryptd.c | 74 struct shash_desc desc; member 190 int (*crypt)(struct blkcipher_desc *desc, in cryptd_blkcipher_crypt() argument 196 struct blkcipher_desc desc; in cryptd_blkcipher_crypt() local 203 desc.tfm = child; in cryptd_blkcipher_crypt() 204 desc.info = req->info; in cryptd_blkcipher_crypt() 205 desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP; in cryptd_blkcipher_crypt() 207 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt() 436 struct shash_desc *desc = &rctx->desc; in cryptd_hash_init() local 441 desc->tfm = child; in cryptd_hash_init() 442 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; in cryptd_hash_init() [all …]
|
D | xts.c | 147 static int encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, in encrypt() argument 150 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in encrypt() 154 return crypt(desc, &w, ctx, crypto_cipher_alg(ctx->tweak)->cia_encrypt, in encrypt() 158 static int decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, in decrypt() argument 161 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in decrypt() 165 return crypt(desc, &w, ctx, crypto_cipher_alg(ctx->tweak)->cia_encrypt, in decrypt() 169 int xts_crypt(struct blkcipher_desc *desc, struct scatterlist *sdst, in xts_crypt() argument 185 err = blkcipher_walk_virt(desc, &walk); in xts_crypt() 227 err = blkcipher_walk_done(desc, &walk, nbytes); in xts_crypt()
|
D | wp512.c | 989 static int wp512_init(struct shash_desc *desc) { in wp512_init() argument 990 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_init() 1003 static int wp512_update(struct shash_desc *desc, const u8 *source, in wp512_update() argument 1006 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_update() 1065 static int wp512_final(struct shash_desc *desc, u8 *out) in wp512_final() argument 1067 struct wp512_ctx *wctx = shash_desc_ctx(desc); in wp512_final() 1100 static int wp384_final(struct shash_desc *desc, u8 *out) in wp384_final() argument 1104 wp512_final(desc, D); in wp384_final() 1111 static int wp256_final(struct shash_desc *desc, u8 *out) in wp256_final() argument 1115 wp512_final(desc, D); in wp256_final()
|
D | testmgr.c | 113 int (*test)(const struct alg_test_desc *desc, const char *driver, 1407 static int alg_test_aead(const struct alg_test_desc *desc, const char *driver, in alg_test_aead() argument 1420 if (desc->suite.aead.enc.vecs) { in alg_test_aead() 1421 err = test_aead(tfm, ENCRYPT, desc->suite.aead.enc.vecs, in alg_test_aead() 1422 desc->suite.aead.enc.count); in alg_test_aead() 1427 if (!err && desc->suite.aead.dec.vecs) in alg_test_aead() 1428 err = test_aead(tfm, DECRYPT, desc->suite.aead.dec.vecs, in alg_test_aead() 1429 desc->suite.aead.dec.count); in alg_test_aead() 1436 static int alg_test_cipher(const struct alg_test_desc *desc, in alg_test_cipher() argument 1449 if (desc->suite.cipher.enc.vecs) { in alg_test_cipher() [all …]
|
D | lrw.c | 195 static int encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, in encrypt() argument 198 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in encrypt() 202 return crypt(desc, &w, ctx, in encrypt() 206 static int decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, in decrypt() argument 209 struct priv *ctx = crypto_blkcipher_ctx(desc->tfm); in decrypt() 213 return crypt(desc, &w, ctx, in decrypt() 217 int lrw_crypt(struct blkcipher_desc *desc, struct scatterlist *sdst, in lrw_crypt() argument 234 err = blkcipher_walk_virt(desc, &walk); in lrw_crypt() 282 err = blkcipher_walk_done(desc, &walk, nbytes); in lrw_crypt()
|
D | salsa20_generic.c | 177 static int encrypt(struct blkcipher_desc *desc, in encrypt() argument 182 struct crypto_blkcipher *tfm = desc->tfm; in encrypt() 187 err = blkcipher_walk_virt_block(desc, &walk, 64); in encrypt() 195 return blkcipher_walk_done(desc, &walk, 0); in encrypt() 202 err = blkcipher_walk_done(desc, &walk, walk.nbytes % 64); in encrypt() 208 err = blkcipher_walk_done(desc, &walk, 0); in encrypt()
|
/crypto/asymmetric_keys/ |
D | x509_public_key.c | 43 struct shash_desc *desc; in x509_check_signature() local 56 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in x509_check_signature() 71 desc = (void *)sig + sizeof(*sig); in x509_check_signature() 72 desc->tfm = tfm; in x509_check_signature() 73 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP; in x509_check_signature() 75 ret = crypto_shash_init(desc); in x509_check_signature() 84 ret = crypto_shash_finup(desc, cert->tbs, cert->tbs_size, sig->digest); in x509_check_signature() 111 char *desc = NULL; in x509_key_preparse() local 191 desc = kmalloc(sulen + 2 + srlen + 1, GFP_KERNEL); in x509_key_preparse() 192 if (!desc) in x509_key_preparse() [all …]
|