Lines Matching refs:sdesc

30 struct sdesc {  struct
38 static struct sdesc *init_sdesc(struct crypto_shash *alg) in init_sdesc() argument
40 struct sdesc *sdesc; in init_sdesc() local
44 sdesc = kmalloc(size, GFP_KERNEL); in init_sdesc()
45 if (!sdesc) in init_sdesc()
47 sdesc->shash.tfm = alg; in init_sdesc()
48 return sdesc; in init_sdesc()
54 struct sdesc *sdesc; in TSS_sha1() local
57 sdesc = init_sdesc(hashalg); in TSS_sha1()
58 if (IS_ERR(sdesc)) { in TSS_sha1()
60 return PTR_ERR(sdesc); in TSS_sha1()
63 ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest); in TSS_sha1()
64 kfree_sensitive(sdesc); in TSS_sha1()
71 struct sdesc *sdesc; in TSS_rawhmac() local
77 sdesc = init_sdesc(hmacalg); in TSS_rawhmac()
78 if (IS_ERR(sdesc)) { in TSS_rawhmac()
80 return PTR_ERR(sdesc); in TSS_rawhmac()
86 ret = crypto_shash_init(&sdesc->shash); in TSS_rawhmac()
100 ret = crypto_shash_update(&sdesc->shash, data, dlen); in TSS_rawhmac()
106 ret = crypto_shash_final(&sdesc->shash, digest); in TSS_rawhmac()
108 kfree_sensitive(sdesc); in TSS_rawhmac()
120 struct sdesc *sdesc; in TSS_authhmac() local
130 sdesc = init_sdesc(hashalg); in TSS_authhmac()
131 if (IS_ERR(sdesc)) { in TSS_authhmac()
133 return PTR_ERR(sdesc); in TSS_authhmac()
137 ret = crypto_shash_init(&sdesc->shash); in TSS_authhmac()
150 ret = crypto_shash_update(&sdesc->shash, data, dlen); in TSS_authhmac()
156 ret = crypto_shash_final(&sdesc->shash, paramdigest); in TSS_authhmac()
162 kfree_sensitive(sdesc); in TSS_authhmac()
185 struct sdesc *sdesc; in TSS_checkhmac1() local
206 sdesc = init_sdesc(hashalg); in TSS_checkhmac1()
207 if (IS_ERR(sdesc)) { in TSS_checkhmac1()
209 return PTR_ERR(sdesc); in TSS_checkhmac1()
211 ret = crypto_shash_init(&sdesc->shash); in TSS_checkhmac1()
214 ret = crypto_shash_update(&sdesc->shash, (const u8 *)&result, in TSS_checkhmac1()
218 ret = crypto_shash_update(&sdesc->shash, (const u8 *)&ordinal, in TSS_checkhmac1()
228 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen); in TSS_checkhmac1()
234 ret = crypto_shash_final(&sdesc->shash, paramdigest); in TSS_checkhmac1()
247 kfree_sensitive(sdesc); in TSS_checkhmac1()
276 struct sdesc *sdesc; in TSS_checkhmac2() local
299 sdesc = init_sdesc(hashalg); in TSS_checkhmac2()
300 if (IS_ERR(sdesc)) { in TSS_checkhmac2()
302 return PTR_ERR(sdesc); in TSS_checkhmac2()
304 ret = crypto_shash_init(&sdesc->shash); in TSS_checkhmac2()
307 ret = crypto_shash_update(&sdesc->shash, (const u8 *)&result, in TSS_checkhmac2()
311 ret = crypto_shash_update(&sdesc->shash, (const u8 *)&ordinal, in TSS_checkhmac2()
322 ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen); in TSS_checkhmac2()
328 ret = crypto_shash_final(&sdesc->shash, paramdigest); in TSS_checkhmac2()
349 kfree_sensitive(sdesc); in TSS_checkhmac2()