Lines Matching refs:sctx

393 static void tpm2_hmac_init(struct sha256_ctx *sctx, u8 *key, u32 key_len)
398 sha256_init(sctx);
406 sha256_update(sctx, pad, sizeof(pad));
409 static void tpm2_hmac_final(struct sha256_ctx *sctx, u8 *key, u32 key_len,
424 sha256_final(sctx, out);
426 sha256_init(sctx);
427 sha256_update(sctx, pad, sizeof(pad));
428 sha256_update(sctx, out, SHA256_DIGEST_SIZE);
429 sha256_final(sctx, out);
443 struct sha256_ctx sctx;
446 tpm2_hmac_init(&sctx, key, key_len);
447 sha256_update(&sctx, (u8 *)&c, sizeof(c));
448 sha256_update(&sctx, label, strlen(label)+1);
449 sha256_update(&sctx, u, SHA256_DIGEST_SIZE);
450 sha256_update(&sctx, v, SHA256_DIGEST_SIZE);
451 sha256_update(&sctx, (u8 *)&bits, sizeof(bits));
452 tpm2_hmac_final(&sctx, key, key_len, out);
470 struct sha256_ctx sctx;
478 sha256_init(&sctx);
480 sha256_update(&sctx, (u8 *)&c, sizeof(c));
482 sha256_update(&sctx, z, EC_PT_SZ);
484 sha256_update(&sctx, str, strlen(str)+1);
485 sha256_update(&sctx, pt_u, EC_PT_SZ);
486 sha256_update(&sctx, pt_v, EC_PT_SZ);
487 sha256_final(&sctx, out);
595 struct sha256_ctx sctx;
683 sha256_init(&sctx);
685 sha256_update(&sctx, (u8 *)&head->ordinal, sizeof(head->ordinal));
693 sha256_update(&sctx, auth->name[i],
698 sha256_update(&sctx, (u8 *)&h, 4);
702 sha256_update(&sctx, &buf->data[offset_s],
704 sha256_final(&sctx, cphash);
707 tpm2_hmac_init(&sctx, auth->session_key, sizeof(auth->session_key)
709 sha256_update(&sctx, cphash, sizeof(cphash));
710 sha256_update(&sctx, auth->our_nonce, sizeof(auth->our_nonce));
711 sha256_update(&sctx, auth->tpm_nonce, sizeof(auth->tpm_nonce));
712 sha256_update(&sctx, &auth->attrs, 1);
713 tpm2_hmac_final(&sctx, auth->session_key, sizeof(auth->session_key)
753 struct sha256_ctx sctx;
813 sha256_init(&sctx);
815 sha256_update(&sctx, (u8 *)&head->return_code,
818 sha256_update(&sctx, (u8 *)&auth->ordinal, sizeof(auth->ordinal));
819 sha256_update(&sctx, &buf->data[offset_p], parm_len);
820 sha256_final(&sctx, rphash);
823 tpm2_hmac_init(&sctx, auth->session_key, sizeof(auth->session_key)
825 sha256_update(&sctx, rphash, sizeof(rphash));
826 sha256_update(&sctx, auth->tpm_nonce, sizeof(auth->tpm_nonce));
827 sha256_update(&sctx, auth->our_nonce, sizeof(auth->our_nonce));
828 sha256_update(&sctx, &auth->attrs, 1);
830 tpm2_hmac_final(&sctx, auth->session_key, sizeof(auth->session_key)