Lines Matching refs:k2
36 struct vb2_private_key *key, *k2; in private_key_tests() local
79 TEST_EQ(vb2_private_key_read(&k2, testfile), in private_key_tests()
85 TEST_SUCC(vb2_private_key_read(&k2, testfile), "Read key good"); in private_key_tests()
86 TEST_PTR_NEQ(k2, NULL, " key_ptr"); in private_key_tests()
87 TEST_EQ(k2->sig_alg, key->sig_alg, " sig alg"); in private_key_tests()
88 TEST_EQ(k2->hash_alg, key->hash_alg, " hash alg"); in private_key_tests()
89 TEST_EQ(memcmp(&k2->guid, &key->guid, sizeof(k2->guid)), 0, " guid"); in private_key_tests()
90 TEST_EQ(strcmp(k2->desc, testdesc), 0, " desc"); in private_key_tests()
91 vb2_private_key_free(k2); in private_key_tests()
100 TEST_SUCC(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
102 vb2_private_key_free(k2); in private_key_tests()
106 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
109 TEST_PTR_EQ(k2, NULL, " key_ptr"); in private_key_tests()
113 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
119 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
125 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
131 TEST_SUCC(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
133 vb2_private_key_free(k2); in private_key_tests()
137 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
143 TEST_EQ(vb2_private_key_unpack(&k2, buf, bufsize), in private_key_tests()
171 struct vb2_public_key *key, k2; in public_key_tests() local
228 TEST_SUCC(vb2_unpack_key(&k2, (uint8_t *)pkey, pkey->c.total_size), in public_key_tests()
230 TEST_EQ(key->arrsize, k2.arrsize, " arrsize"); in public_key_tests()
231 TEST_EQ(key->n0inv, k2.n0inv, " n0inv"); in public_key_tests()
232 TEST_EQ(memcmp(key->n, k2.n, key->arrsize * sizeof(uint32_t)), 0, in public_key_tests()
234 TEST_EQ(memcmp(key->rr, k2.rr, key->arrsize * sizeof(uint32_t)), 0, in public_key_tests()
262 TEST_EQ(vb2_public_key_hash(&k2, VB2_HASH_INVALID), in public_key_tests()
266 TEST_SUCC(vb2_public_key_hash(&k2, combo->hash_alg), "Hash key"); in public_key_tests()
267 TEST_EQ(k2.hash_alg, combo->hash_alg, " hash_alg"); in public_key_tests()
268 TEST_EQ(k2.sig_alg, VB2_SIG_NONE, " sig_alg"); in public_key_tests()
269 TEST_EQ(memcmp(k2.guid, vb2_hash_guid(combo->hash_alg), in public_key_tests()
270 sizeof(*k2.guid)), 0, " guid"); in public_key_tests()
272 TEST_SUCC(vb2_public_key_pack(&pkey, &k2), "Pack public hash key"); in public_key_tests()
274 TEST_SUCC(vb2_unpack_key(&k2, (uint8_t *)pkey, pkey->c.total_size), in public_key_tests()