Home
last modified time | relevance | path

Searched refs:desc (Results 1 – 25 of 37) sorted by relevance

12

/crypto/
Dshash.c91 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() argument
94 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned()
114 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned()
118 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned()
121 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument
124 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update()
129 return shash_update_unaligned(desc, data, len); in crypto_shash_update()
131 return shash->update(desc, data, len); in crypto_shash_update()
135 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument
137 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned()
[all …]
Dsha256_generic.c36 static int crypto_sha256_init(struct shash_desc *desc) in crypto_sha256_init() argument
38 sha256_init(shash_desc_ctx(desc)); in crypto_sha256_init()
42 static int crypto_sha224_init(struct shash_desc *desc) in crypto_sha224_init() argument
44 sha224_init(shash_desc_ctx(desc)); in crypto_sha224_init()
48 int crypto_sha256_update(struct shash_desc *desc, const u8 *data, in crypto_sha256_update() argument
51 sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_update()
56 static int crypto_sha256_final(struct shash_desc *desc, u8 *out) in crypto_sha256_final() argument
58 if (crypto_shash_digestsize(desc->tfm) == SHA224_DIGEST_SIZE) in crypto_sha256_final()
59 sha224_final(shash_desc_ctx(desc), out); in crypto_sha256_final()
61 sha256_final(shash_desc_ctx(desc), out); in crypto_sha256_final()
[all …]
Dcrc32_generic.c69 static int crc32_init(struct shash_desc *desc) in crc32_init() argument
71 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_init()
72 u32 *crcp = shash_desc_ctx(desc); in crc32_init()
79 static int crc32_update(struct shash_desc *desc, const u8 *data, in crc32_update() argument
82 u32 *crcp = shash_desc_ctx(desc); in crc32_update()
96 static int crc32_finup(struct shash_desc *desc, const u8 *data, in crc32_finup() argument
99 return __crc32_finup(shash_desc_ctx(desc), data, len, out); in crc32_finup()
102 static int crc32_final(struct shash_desc *desc, u8 *out) in crc32_final() argument
104 u32 *crcp = shash_desc_ctx(desc); in crc32_final()
110 static int crc32_digest(struct shash_desc *desc, const u8 *data, in crc32_digest() argument
[all …]
Dcrc32c_generic.c57 static int chksum_init(struct shash_desc *desc) in chksum_init() argument
59 struct chksum_ctx *mctx = crypto_shash_ctx(desc->tfm); in chksum_init()
60 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_init()
83 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument
86 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update()
92 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument
94 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final()
106 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument
109 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup()
114 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument
[all …]
Dcrct10dif_generic.c42 static int chksum_init(struct shash_desc *desc) in chksum_init() argument
44 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_init()
51 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() argument
54 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_update()
60 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() argument
62 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_final()
74 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() argument
77 struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); in chksum_finup()
82 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() argument
Dxxhash_generic.c31 static int xxhash64_init(struct shash_desc *desc) in xxhash64_init() argument
33 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_init()
34 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_init()
41 static int xxhash64_update(struct shash_desc *desc, const u8 *data, in xxhash64_update() argument
44 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_update()
51 static int xxhash64_final(struct shash_desc *desc, u8 *out) in xxhash64_final() argument
53 struct xxhash64_desc_ctx *dctx = shash_desc_ctx(desc); in xxhash64_final()
60 static int xxhash64_digest(struct shash_desc *desc, const u8 *data, in xxhash64_digest() argument
63 struct xxhash64_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in xxhash64_digest()
Dsha1_generic.c42 int crypto_sha1_update(struct shash_desc *desc, const u8 *data, in crypto_sha1_update() argument
45 return sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_update()
49 static int sha1_final(struct shash_desc *desc, u8 *out) in sha1_final() argument
51 sha1_base_do_finalize(desc, sha1_generic_block_fn); in sha1_final()
52 return sha1_base_finish(desc, out); in sha1_final()
55 int crypto_sha1_finup(struct shash_desc *desc, const u8 *data, in crypto_sha1_finup() argument
58 sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_finup()
59 return sha1_final(desc, out); in crypto_sha1_finup()
Dhmac.c85 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_export() local
87 return crypto_shash_export(desc, out); in hmac_export()
92 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_import() local
95 desc->tfm = ctx->hash; in hmac_import()
97 return crypto_shash_import(desc, in); in hmac_import()
108 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_update() local
110 return crypto_shash_update(desc, data, nbytes); in hmac_update()
119 struct shash_desc *desc = shash_desc_ctx(pdesc); in hmac_final() local
121 return crypto_shash_final(desc, out) ?: in hmac_final()
122 crypto_shash_import(desc, opad) ?: in hmac_final()
[all …]
Dsm2.c24 const char *desc; /* Description of the curve. */ member
49 .desc = "sm2p256v1",
107 ec->name = ecp->desc; in sm2_ec_ctx_init()
216 static int sm2_z_digest_update(struct shash_desc *desc, in sm2_z_digest_update() argument
229 crypto_sm3_update(desc, zero, pbytes - inlen); in sm2_z_digest_update()
230 crypto_sm3_update(desc, in, inlen); in sm2_z_digest_update()
233 crypto_sm3_update(desc, in + inlen - pbytes, pbytes); in sm2_z_digest_update()
235 crypto_sm3_update(desc, in, inlen); in sm2_z_digest_update()
242 static int sm2_z_digest_update_point(struct shash_desc *desc, in sm2_z_digest_update_point() argument
252 !sm2_z_digest_update(desc, x, pbytes) && in sm2_z_digest_update_point()
[all …]
Dghash-generic.c46 static int ghash_init(struct shash_desc *desc) in ghash_init() argument
48 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_init()
78 static int ghash_update(struct shash_desc *desc, in ghash_update() argument
81 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_update()
82 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_update()
131 static int ghash_final(struct shash_desc *desc, u8 *dst) in ghash_final() argument
133 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); in ghash_final()
134 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); in ghash_final()
Dnhpoly1305.c144 int crypto_nhpoly1305_init(struct shash_desc *desc) in crypto_nhpoly1305_init() argument
146 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_init()
155 int crypto_nhpoly1305_update_helper(struct shash_desc *desc, in crypto_nhpoly1305_update_helper() argument
159 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_update_helper()
160 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_update_helper()
191 int crypto_nhpoly1305_update(struct shash_desc *desc, in crypto_nhpoly1305_update() argument
194 return crypto_nhpoly1305_update_helper(desc, src, srclen, nh_generic); in crypto_nhpoly1305_update()
198 int crypto_nhpoly1305_final_helper(struct shash_desc *desc, u8 *dst, nh_t nh_fn) in crypto_nhpoly1305_final_helper() argument
200 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_final_helper()
201 const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); in crypto_nhpoly1305_final_helper()
[all …]
Dtgr192.c493 static int tgr192_init(struct shash_desc *desc) in tgr192_init() argument
495 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_init()
509 static int tgr192_update(struct shash_desc *desc, const u8 *inbuf, in tgr192_update() argument
512 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_update()
526 tgr192_update(desc, NULL, 0); in tgr192_update()
550 static int tgr192_final(struct shash_desc *desc, u8 * out) in tgr192_final() argument
552 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_final()
558 tgr192_update(desc, NULL, 0); /* flush */ in tgr192_final()
586 tgr192_update(desc, NULL, 0); /* flush */ in tgr192_final()
604 static int tgr160_final(struct shash_desc *desc, u8 * out) in tgr160_final() argument
[all …]
Dmichael_mic.c47 static int michael_init(struct shash_desc *desc) in michael_init() argument
49 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_init()
50 struct michael_mic_ctx *ctx = crypto_shash_ctx(desc->tfm); in michael_init()
59 static int michael_update(struct shash_desc *desc, const u8 *data, in michael_update() argument
62 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_update()
97 static int michael_final(struct shash_desc *desc, u8 *out) in michael_final() argument
99 struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); in michael_final()
Dpoly1305_generic.c22 static int crypto_poly1305_init(struct shash_desc *desc) in crypto_poly1305_init() argument
24 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_init()
72 static int crypto_poly1305_update(struct shash_desc *desc, in crypto_poly1305_update() argument
75 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_update()
106 static int crypto_poly1305_final(struct shash_desc *desc, u8 *dst) in crypto_poly1305_final() argument
108 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); in crypto_poly1305_final()
Dsm3_generic.c145 int crypto_sm3_update(struct shash_desc *desc, const u8 *data, in crypto_sm3_update() argument
148 return sm3_base_do_update(desc, data, len, sm3_generic_block_fn); in crypto_sm3_update()
152 int crypto_sm3_final(struct shash_desc *desc, u8 *out) in crypto_sm3_final() argument
154 sm3_base_do_finalize(desc, sm3_generic_block_fn); in crypto_sm3_final()
155 return sm3_base_finish(desc, out); in crypto_sm3_final()
159 int crypto_sm3_finup(struct shash_desc *desc, const u8 *data, in crypto_sm3_finup() argument
162 sm3_base_do_update(desc, data, len, sm3_generic_block_fn); in crypto_sm3_finup()
163 return crypto_sm3_final(desc, hash); in crypto_sm3_finup()
Dblake2s_generic.c15 static int crypto_blake2s_update_generic(struct shash_desc *desc, in crypto_blake2s_update_generic() argument
18 return crypto_blake2s_update(desc, in, inlen, true); in crypto_blake2s_update_generic()
21 static int crypto_blake2s_final_generic(struct shash_desc *desc, u8 *out) in crypto_blake2s_final_generic() argument
23 return crypto_blake2s_final(desc, out, true); in crypto_blake2s_final_generic()
Dsha512_generic.c160 int crypto_sha512_update(struct shash_desc *desc, const u8 *data, in crypto_sha512_update() argument
163 return sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_update()
167 static int sha512_final(struct shash_desc *desc, u8 *hash) in sha512_final() argument
169 sha512_base_do_finalize(desc, sha512_generic_block_fn); in sha512_final()
170 return sha512_base_finish(desc, hash); in sha512_final()
173 int crypto_sha512_finup(struct shash_desc *desc, const u8 *data, in crypto_sha512_finup() argument
176 sha512_base_do_update(desc, data, len, sha512_generic_block_fn); in crypto_sha512_finup()
177 return sha512_final(desc, hash); in crypto_sha512_finup()
Dsha3_generic.c161 int crypto_sha3_init(struct shash_desc *desc) in crypto_sha3_init() argument
163 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_init()
164 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in crypto_sha3_init()
175 int crypto_sha3_update(struct shash_desc *desc, const u8 *data, in crypto_sha3_update() argument
178 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_update()
213 int crypto_sha3_final(struct shash_desc *desc, u8 *out) in crypto_sha3_final() argument
215 struct sha3_state *sctx = shash_desc_ctx(desc); in crypto_sha3_final()
217 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in crypto_sha3_final()
Dwp512.c989 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()
Dmd5.c129 static int md5_init(struct shash_desc *desc) in md5_init() argument
131 struct md5_state *mctx = shash_desc_ctx(desc); in md5_init()
142 static int md5_update(struct shash_desc *desc, const u8 *data, unsigned int len) in md5_update() argument
144 struct md5_state *mctx = shash_desc_ctx(desc); in md5_update()
174 static int md5_final(struct shash_desc *desc, u8 *out) in md5_final() argument
176 struct md5_state *mctx = shash_desc_ctx(desc); in md5_final()
202 static int md5_export(struct shash_desc *desc, void *out) in md5_export() argument
204 struct md5_state *ctx = shash_desc_ctx(desc); in md5_export()
210 static int md5_import(struct shash_desc *desc, const void *in) in md5_import() argument
212 struct md5_state *ctx = shash_desc_ctx(desc); in md5_import()
Dstreebog_generic.c908 static int streebog_init(struct shash_desc *desc) in streebog_init() argument
910 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_init()
911 unsigned int digest_size = crypto_shash_digestsize(desc->tfm); in streebog_init()
1002 static int streebog_update(struct shash_desc *desc, const u8 *data, in streebog_update() argument
1005 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_update()
1036 static int streebog_final(struct shash_desc *desc, u8 *digest) in streebog_final() argument
1038 struct streebog_state *ctx = shash_desc_ctx(desc); in streebog_final()
1042 if (crypto_shash_digestsize(desc->tfm) == STREEBOG256_DIGEST_SIZE) in streebog_final()
/crypto/asymmetric_keys/
Dx509_public_key.c27 struct shash_desc *desc; in x509_get_sig_params() local
66 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in x509_get_sig_params()
74 desc = kzalloc(desc_size, GFP_KERNEL); in x509_get_sig_params()
75 if (!desc) in x509_get_sig_params()
78 desc->tfm = tfm; in x509_get_sig_params()
80 ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); in x509_get_sig_params()
93 kfree(desc); in x509_get_sig_params()
170 char *desc = NULL, *p; in x509_key_preparse() local
214 desc = kmalloc(sulen + 2 + srlen * 2 + 1, GFP_KERNEL); in x509_key_preparse()
215 if (!desc) in x509_key_preparse()
[all …]
Dverify_pefile.c247 struct shash_desc *desc) in pefile_digest_pe_contents() argument
255 ret = crypto_shash_update(desc, pebuf, ctx->image_checksum_offset); in pefile_digest_pe_contents()
260 ret = crypto_shash_update(desc, pebuf + tmp, in pefile_digest_pe_contents()
266 ret = crypto_shash_update(desc, pebuf + tmp, ctx->header_size - tmp); in pefile_digest_pe_contents()
295 ret = crypto_shash_update(desc, in pefile_digest_pe_contents()
308 ret = crypto_shash_update(desc, in pefile_digest_pe_contents()
326 struct shash_desc *desc; in pefile_digest_pe() local
340 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pefile_digest_pe()
352 desc = kzalloc(desc_size + digest_size, GFP_KERNEL); in pefile_digest_pe()
353 if (!desc) in pefile_digest_pe()
[all …]
Dpkcs7_verify.c27 struct shash_desc *desc; in pkcs7_digest() local
47 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in pkcs7_digest()
55 desc = kzalloc(desc_size, GFP_KERNEL); in pkcs7_digest()
56 if (!desc) in pkcs7_digest()
59 desc->tfm = tfm; in pkcs7_digest()
62 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len, in pkcs7_digest()
103 ret = crypto_shash_init(desc); in pkcs7_digest()
107 ret = crypto_shash_update(desc, &tag, 1); in pkcs7_digest()
110 ret = crypto_shash_finup(desc, sinfo->authattrs, in pkcs7_digest()
118 kfree(desc); in pkcs7_digest()
Dpublic_key.c256 struct shash_desc *desc; in cert_sig_digest_update() local
276 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc); in cert_sig_digest_update()
277 desc = kzalloc(desc_size, GFP_KERNEL); in cert_sig_digest_update()
278 if (!desc) { in cert_sig_digest_update()
283 desc->tfm = tfm; in cert_sig_digest_update()
285 ret = crypto_shash_init(desc); in cert_sig_digest_update()
289 ret = crypto_shash_update(desc, dgst, SM3_DIGEST_SIZE); in cert_sig_digest_update()
293 ret = crypto_shash_finup(desc, sig->data, sig->data_size, sig->digest); in cert_sig_digest_update()
296 kfree(desc); in cert_sig_digest_update()

12