Lines Matching defs:ses

244 padlock_hash_key_setup(struct padlock_session *ses, caddr_t key, int klen)
250 axf = ses->ses_axf;
257 padlock_free_ctx(axf, ses->ses_ictx);
258 padlock_free_ctx(axf, ses->ses_octx);
263 axf->Init(ses->ses_ictx);
264 axf->Update(ses->ses_ictx, key, klen);
265 axf->Update(ses->ses_ictx, hmac_ipad_buffer, axf->blocksize - klen);
270 axf->Init(ses->ses_octx);
271 axf->Update(ses->ses_octx, key, klen);
272 axf->Update(ses->ses_octx, hmac_opad_buffer, axf->blocksize - klen);
282 padlock_authcompute(struct padlock_session *ses, struct cryptodesc *crd,
290 axf = ses->ses_axf;
292 padlock_copy_ctx(axf, ses->ses_ictx, &ctx);
301 padlock_copy_ctx(axf, ses->ses_octx, &ctx);
307 ses->ses_mlen == 0 ? axf->hashsize : ses->ses_mlen, hash);
312 padlock_hash_setup(struct padlock_session *ses, struct cryptoini *macini)
315 ses->ses_mlen = macini->cri_mlen;
320 ses->ses_axf = &auth_hash_null;
323 ses->ses_axf = &auth_hash_hmac_md5;
327 ses->ses_axf = &padlock_hmac_sha1;
329 ses->ses_axf = &auth_hash_hmac_sha1;
332 ses->ses_axf = &auth_hash_hmac_ripemd_160;
336 ses->ses_axf = &padlock_hmac_sha256;
338 ses->ses_axf = &auth_hash_hmac_sha2_256;
341 ses->ses_axf = &auth_hash_hmac_sha2_384;
344 ses->ses_axf = &auth_hash_hmac_sha2_512;
349 ses->ses_ictx = malloc(ses->ses_axf->ctxsize, M_PADLOCK,
351 ses->ses_octx = malloc(ses->ses_axf->ctxsize, M_PADLOCK,
353 if (ses->ses_ictx == NULL || ses->ses_octx == NULL)
358 padlock_hash_key_setup(ses, macini->cri_key,
365 padlock_hash_process(struct padlock_session *ses, struct cryptodesc *maccrd,
372 error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL |
377 padlock_hash_key_setup(ses, maccrd->crd_key, maccrd->crd_klen);
379 error = padlock_authcompute(ses, maccrd, crp->crp_buf, crp->crp_flags);
380 fpu_kern_leave(td, ses->ses_fpu_ctx);
385 padlock_hash_free(struct padlock_session *ses)
388 if (ses->ses_ictx != NULL) {
389 padlock_free_ctx(ses->ses_axf, ses->ses_ictx);
390 bzero(ses->ses_ictx, ses->ses_axf->ctxsize);
391 free(ses->ses_ictx, M_PADLOCK);
392 ses->ses_ictx = NULL;
394 if (ses->ses_octx != NULL) {
395 padlock_free_ctx(ses->ses_axf, ses->ses_octx);
396 bzero(ses->ses_octx, ses->ses_axf->ctxsize);
397 free(ses->ses_octx, M_PADLOCK);
398 ses->ses_octx = NULL;