Home | History | Annotate | Download | only in unittests

Lines Matching refs:tpm

16 /// TPM Sign unit tests.
39 // Verify signature computed by TPM ECDAA scheme:
81 // create TPM context
85 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
86 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
88 EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
98 Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
105 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
115 // create TPM context
119 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
120 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
122 EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
133 Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
136 Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
144 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
147 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
164 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
165 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
166 THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
168 Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
173 EXPECT_EQ(kEpidBadArgErr, Tpm2Sign(tpm, nullptr, sizeof(this->kDigestSha256),
176 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
188 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
189 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
190 THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
192 Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
195 EXPECT_EQ(kEpidBadArgErr, Tpm2Sign(tpm, digest, 0, counter, sig_k, sig_s));
197 Tpm2Sign(tpm, digest, EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT + 1,
200 Tpm2Sign(tpm, digest, EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT - 1,
215 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
216 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
217 THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
220 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
223 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256), one,
226 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
230 Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
234 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
236 THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
247 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
248 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
249 THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
251 Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
254 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
257 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
269 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
272 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
279 // create TPM context
283 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
291 // create TPM context
295 Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
296 THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
298 EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
308 Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
310 EXPECT_EQ(kEpidNoErr, Tpm2ReleaseCounter(tpm, counter));
316 Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),