Lines Matching defs:cc
22 static struct vb2_context cc;
58 memset(&cc, 0, sizeof(cc));
59 cc.workbuf = workbuf;
60 cc.workbuf_size = sizeof(workbuf);
62 vb2_init_context(&cc);
63 sd = vb2_get_sd(&cc);
65 vb2_nv_init(&cc);
67 vb2_secdata_create(&cc);
68 vb2_secdata_init(&cc);
75 sd->workbuf_preamble_offset = cc.workbuf_used;
77 cc.workbuf_used = sd->workbuf_preamble_offset
80 (cc.workbuf + sd->workbuf_preamble_offset);
88 sd->workbuf_data_key_offset = cc.workbuf_used;
90 cc.workbuf_used = sd->workbuf_data_key_offset +
93 (cc.workbuf + sd->workbuf_data_key_offset);
97 vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, NULL);
100 vb2api_extend_hash(&cc, mock_body, mock_body_size);
218 TEST_SUCC(vb2api_fw_phase3(&cc), "phase3 good");
222 TEST_EQ(vb2api_fw_phase3(&cc), VB2_ERROR_MOCK, "phase3 keyblock");
223 TEST_EQ(vb2_nv_get(&cc, VB2_NV_RECOVERY_REQUEST),
228 TEST_EQ(vb2api_fw_phase3(&cc), VB2_ERROR_MOCK, "phase3 keyblock");
229 TEST_EQ(vb2_nv_get(&cc, VB2_NV_RECOVERY_REQUEST),
241 wb_used_before = cc.workbuf_used;
242 TEST_SUCC(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
250 TEST_EQ(cc.workbuf_used,
256 wb_used_before = cc.workbuf_used;
257 TEST_SUCC(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, NULL),
259 TEST_EQ(cc.workbuf_used, wb_used_before, "init hash reuses context");
262 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_INVALID, &size),
267 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
271 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY + 1, &size),
275 cc.workbuf_used =
276 cc.workbuf_size - sizeof(struct vb2_digest_context) + 8;
277 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
282 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
287 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
291 k = (struct vb2_packed_key *)(cc.workbuf + sd->workbuf_data_key_offset);
293 TEST_EQ(vb2api_init_hash(&cc, VB2_HASH_TAG_FW_BODY, &size),
302 TEST_SUCC(vb2api_extend_hash(&cc, mock_body, 32),
306 TEST_SUCC(vb2api_extend_hash(&cc, mock_body, mock_body_size - 32),
312 TEST_EQ(vb2api_extend_hash(&cc, mock_body, mock_body_size),
316 TEST_EQ(vb2api_extend_hash(&cc, mock_body, mock_body_size + 1),
320 TEST_EQ(vb2api_extend_hash(&cc, mock_body, 0),
326 (cc.workbuf + sd->workbuf_hash_offset);
328 TEST_EQ(vb2api_extend_hash(&cc, mock_body, mock_body_size),
338 TEST_SUCC(vb2api_check_hash(&cc), "check hash good");
342 TEST_EQ(vb2api_check_hash(&cc),
347 TEST_EQ(vb2api_check_hash(&cc),
352 TEST_EQ(vb2api_check_hash(&cc),
356 cc.workbuf_used = cc.workbuf_size;
357 TEST_EQ(vb2api_check_hash(&cc),
362 TEST_EQ(vb2api_check_hash(&cc), VB2_ERROR_MOCK, "check hash finalize");
366 TEST_EQ(vb2api_check_hash(&cc),
371 TEST_EQ(vb2api_check_hash(&cc),
376 TEST_EQ(vb2api_check_hash(&cc),
381 (cc.workbuf + sd->workbuf_preamble_offset);
383 TEST_EQ(vb2api_check_hash(&cc),
388 TEST_EQ(vb2api_check_hash(&cc),