Lines Matching refs:sdesc
94 struct kdf_sdesc *sdesc; in kdf_alloc() local
111 sdesc = kmalloc(size, GFP_KERNEL); in kdf_alloc()
112 if (!sdesc) in kdf_alloc()
114 sdesc->shash.tfm = tfm; in kdf_alloc()
115 sdesc->shash.flags = 0x0; in kdf_alloc()
117 *sdesc_ret = sdesc; in kdf_alloc()
126 static void kdf_dealloc(struct kdf_sdesc *sdesc) in kdf_dealloc() argument
128 if (!sdesc) in kdf_dealloc()
131 if (sdesc->shash.tfm) in kdf_dealloc()
132 crypto_free_shash(sdesc->shash.tfm); in kdf_dealloc()
134 kzfree(sdesc); in kdf_dealloc()
148 static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, in kdf_ctr() argument
151 struct shash_desc *desc = &sdesc->shash; in kdf_ctr()
204 static int keyctl_dh_compute_kdf(struct kdf_sdesc *sdesc, in keyctl_dh_compute_kdf() argument
211 crypto_shash_digestsize(sdesc->shash.tfm)); in keyctl_dh_compute_kdf()
219 ret = kdf_ctr(sdesc, kbuf, kbuflen, outbuf, outbuf_len, lzero); in keyctl_dh_compute_kdf()
248 struct kdf_sdesc *sdesc = NULL; in __keyctl_dh_compute() local
281 ret = kdf_alloc(&sdesc, hashname); in __keyctl_dh_compute()
391 ret = keyctl_dh_compute_kdf(sdesc, buffer, buflen, outbuf, in __keyctl_dh_compute()
411 kdf_dealloc(sdesc); in __keyctl_dh_compute()