mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 18:57:07 -07:00
parent
163fa81c03
commit
59e6603256
10 changed files with 272 additions and 108 deletions
|
@ -58,6 +58,7 @@ static MunitResult test_key_stream(const MunitParameter params[], void *user)
|
|||
static const uint8_t gkcrypt_key[] = { 0x8, 0x81, 0x6f, 0xa2, 0xe5, 0x55, 0x89, 0x61, 0xd5, 0xa2, 0x86, 0xd9, 0xe, 0xec, 0x5b, 0x8c };
|
||||
static const uint8_t gkcrypt_iv[] = { 0x2a, 0xe1, 0xbb, 0x3d, 0x84, 0xdc, 0x9a, 0xa9, 0xc3, 0x52, 0xa4, 0xcf, 0x3f, 0xfb, 0x8b, 0x72 };
|
||||
static const uint8_t key_stream[] = { 0xf, 0x6d, 0x89, 0x85, 0x5b, 0xa7, 0x86, 0x74, 0x5b, 0xa1, 0xfe, 0x5c, 0x81, 0x19, 0x6c, 0xd5, 0x54, 0xc4, 0x1c, 0xca, 0xf6, 0xe9, 0x34, 0xa4, 0x89, 0x26, 0x98, 0xb0, 0x62, 0x12, 0xb3, 0x1a };
|
||||
static const uint8_t key_stream_high[] = { 0x14, 0x31, 0x9f, 0xf8, 0xbe, 0x08, 0x17, 0xa4, 0xfc, 0x28, 0x49, 0x0b, 0x1e, 0x5f, 0x7b, 0x7e, 0xfa, 0xe9, 0x14, 0xde, 0xc6, 0xdf, 0xe7, 0x5d, 0xd6, 0x9c, 0x75, 0x3f, 0x94, 0x62, 0xd5, 0x2c };
|
||||
|
||||
ChiakiLog log;
|
||||
|
||||
|
@ -79,6 +80,17 @@ static MunitResult test_key_stream(const MunitParameter params[], void *user)
|
|||
|
||||
munit_assert_memory_equal(sizeof(key_stream), key_stream_result, key_stream);
|
||||
|
||||
uint64_t key_pos = ((uint64_t)(1ull << 32)) + 0x420;
|
||||
|
||||
err = chiaki_gkcrypt_gen_key_stream(&gkcrypt, key_pos, key_stream_result, sizeof(key_stream_result));
|
||||
if (err != CHIAKI_ERR_SUCCESS)
|
||||
{
|
||||
chiaki_gkcrypt_fini(&gkcrypt);
|
||||
return MUNIT_ERROR;
|
||||
}
|
||||
|
||||
munit_assert_memory_equal(sizeof(key_stream_high), key_stream_result, key_stream_high);
|
||||
|
||||
chiaki_gkcrypt_fini(&gkcrypt);
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
@ -92,6 +104,7 @@ static MunitResult test_endecrypt(const MunitParameter params[], void *user)
|
|||
static const uint8_t gkcrypt_iv[] = { 0xef, 0x20, 0x40, 0xc2, 0x15, 0x3c, 0x2, 0x66, 0x32, 0x1f, 0x42, 0xbb, 0xf4, 0x50, 0x34, 0x4d };
|
||||
static const uint8_t clear_data[] = { 0x4e, 0x61, 0x9f, 0x94, 0x5d, 0x4b, 0x8e, 0xbd, 0x2a, 0x15, 0x4d, 0x3, 0x6a, 0xcd, 0x49, 0x56, 0x9c, 0xc7, 0x5c, 0xe3, 0xe7, 0x0, 0x17, 0x9a, 0x38, 0xd9, 0x69, 0x53, 0x45, 0xf9, 0xc, 0xb5, 0x8c, 0x5, 0x65, 0xf, 0x70 };
|
||||
static const uint8_t enc_data[] = { 0x23, 0xf4, 0x8d, 0xd8, 0xaa, 0xf9, 0x58, 0x9b, 0xb1, 0x94, 0x4f, 0xad, 0x2b, 0x8d, 0xaa, 0x8d, 0x25, 0x88, 0xfa, 0xf8, 0xb6, 0xd4, 0x17, 0xf4, 0x5f, 0x78, 0xec, 0xf5, 0x4e, 0x37, 0x20, 0xb0, 0x76, 0x81, 0x7, 0x67, 0x9a };
|
||||
static const uint8_t enc_data_high[] = { 0x2b, 0x9e, 0xe9, 0x83, 0x27, 0x44, 0x08, 0xb1, 0x17, 0xf5, 0x37, 0xa0, 0xd9, 0xc2, 0xc6, 0x05, 0x95, 0x78, 0xb2, 0x78, 0xfd, 0x17, 0x8c, 0x52, 0xf4, 0x17, 0x9d, 0xee, 0x3f, 0x62, 0xe6, 0x30, 0x01, 0x61, 0x4c, 0xf4, 0xa1 };
|
||||
|
||||
ChiakiLog log;
|
||||
|
||||
|
@ -113,6 +126,7 @@ static MunitResult test_endecrypt(const MunitParameter params[], void *user)
|
|||
|
||||
uint8_t buf[0x25];
|
||||
|
||||
// Low
|
||||
memcpy(buf, clear_data, sizeof(buf));
|
||||
err = chiaki_gkcrypt_encrypt(&gkcrypt, 0x11, buf, sizeof(buf));
|
||||
if(err != CHIAKI_ERR_SUCCESS)
|
||||
|
@ -131,6 +145,26 @@ static MunitResult test_endecrypt(const MunitParameter params[], void *user)
|
|||
}
|
||||
munit_assert_memory_equal(sizeof(buf), buf, enc_data);
|
||||
|
||||
// High
|
||||
uint64_t key_pos_high = ((uint64_t)(1ull << 32)) + 0x420;
|
||||
memcpy(buf, clear_data, sizeof(buf));
|
||||
err = chiaki_gkcrypt_encrypt(&gkcrypt, key_pos_high, buf, sizeof(buf));
|
||||
if (err != CHIAKI_ERR_SUCCESS)
|
||||
{
|
||||
chiaki_gkcrypt_fini(&gkcrypt);
|
||||
return MUNIT_ERROR;
|
||||
}
|
||||
munit_assert_memory_equal(sizeof(buf), buf, enc_data_high);
|
||||
|
||||
memcpy(buf, clear_data, sizeof(buf));
|
||||
err = chiaki_gkcrypt_decrypt(&gkcrypt, key_pos_high, buf, sizeof(buf));
|
||||
if (err != CHIAKI_ERR_SUCCESS)
|
||||
{
|
||||
chiaki_gkcrypt_fini(&gkcrypt);
|
||||
return MUNIT_ERROR;
|
||||
}
|
||||
munit_assert_memory_equal(sizeof(buf), buf, enc_data_high);
|
||||
|
||||
chiaki_gkcrypt_fini(&gkcrypt);
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
@ -158,15 +192,19 @@ static MunitResult test_gmac(const MunitParameter params[], void *user)
|
|||
0x64, 0x2d, 0xcb, 0x98, 0x0f, 0x43, 0xa6, 0xe1, 0x4c, 0xe7, 0x9f, 0x2d, 0xab, 0x94, 0x01, 0xd7,
|
||||
0x52, 0x84, 0x19 };
|
||||
|
||||
static const size_t key_pos = 0x69a0;
|
||||
static const uint64_t key_pos = 0x69a0;
|
||||
static const uint64_t key_pos_high = ((uint64_t)(1ull << 32)) + 0x420;
|
||||
|
||||
static const uint8_t gmac_expected[] = { 0x6f, 0x81, 0x10, 0x97 };
|
||||
static const uint8_t gmac_expected_high[] = { 0x4a, 0x30, 0x98, 0x10 };
|
||||
|
||||
ChiakiGKCrypt gkcrypt;
|
||||
memset(&gkcrypt, 0, sizeof(gkcrypt));
|
||||
|
||||
// Low
|
||||
memset(&gkcrypt, 0, sizeof(gkcrypt));
|
||||
memcpy(gkcrypt.key_gmac_current, gkcrypt_key, sizeof(gkcrypt.key_gmac_current));
|
||||
memcpy(gkcrypt.iv, gkcrypt_iv, sizeof(gkcrypt.iv));
|
||||
|
||||
gkcrypt.key_buf = NULL;
|
||||
gkcrypt.key_buf_size = 0;
|
||||
gkcrypt.key_gmac_index_current = 0;
|
||||
|
@ -178,6 +216,21 @@ static MunitResult test_gmac(const MunitParameter params[], void *user)
|
|||
|
||||
munit_assert_memory_equal(sizeof(gmac), gmac, gmac_expected);
|
||||
|
||||
// High
|
||||
memset(&gkcrypt, 0, sizeof(gkcrypt));
|
||||
memcpy(gkcrypt.key_gmac_current, gkcrypt_key, sizeof(gkcrypt.key_gmac_current));
|
||||
memcpy(gkcrypt.iv, gkcrypt_iv, sizeof(gkcrypt.iv));
|
||||
|
||||
gkcrypt.key_buf = NULL;
|
||||
gkcrypt.key_buf_size = 0;
|
||||
gkcrypt.key_gmac_index_current = 0;
|
||||
|
||||
err = chiaki_gkcrypt_gmac(&gkcrypt, key_pos_high, buf, sizeof(buf), gmac);
|
||||
if (err != CHIAKI_ERR_SUCCESS)
|
||||
return MUNIT_ERROR;
|
||||
|
||||
munit_assert_memory_equal(sizeof(gmac), gmac, gmac_expected_high);
|
||||
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
||||
|
@ -242,9 +295,11 @@ static MunitResult test_gmac_split(const MunitParameter params[], void *user)
|
|||
0xfa, 0x44, 0xc6, 0xd8, 0x19, 0x1, 0x8d, 0x41, 0x1f, 0xc7, 0xf, 0x89, 0x1d, 0xef, 0x34, 0x9a,
|
||||
0x68, 0x77, 0x8c };
|
||||
|
||||
static const size_t key_pos = 0xadf0;
|
||||
static const uint64_t key_pos = 0xadf0;
|
||||
static const uint64_t key_pos_high = ((uint64_t)(1ull << 32)) + 0x420;
|
||||
|
||||
static const uint8_t gmac_expected[] = { 0xd6, 0x6a, 0x07, 0xb7 };
|
||||
static const uint8_t gmac_expected_high[] = { 0xf0, 0x17, 0x95, 0x3c };
|
||||
|
||||
ChiakiGKCrypt gkcrypt;
|
||||
memset(&gkcrypt, 0, sizeof(gkcrypt));
|
||||
|
@ -262,6 +317,21 @@ static MunitResult test_gmac_split(const MunitParameter params[], void *user)
|
|||
|
||||
munit_assert_memory_equal(sizeof(gmac), gmac, gmac_expected);
|
||||
|
||||
// High
|
||||
memset(&gkcrypt, 0, sizeof(gkcrypt));
|
||||
|
||||
memcpy(gkcrypt.key_gmac_current, gkcrypt_key, sizeof(gkcrypt.key_gmac_current));
|
||||
memcpy(gkcrypt.iv, gkcrypt_iv, sizeof(gkcrypt.iv));
|
||||
gkcrypt.key_buf = NULL;
|
||||
gkcrypt.key_buf_size = 0;
|
||||
gkcrypt.key_gmac_index_current = 0;
|
||||
|
||||
err = chiaki_gkcrypt_gmac(&gkcrypt, key_pos_high, buf, sizeof(buf), gmac);
|
||||
if (err != CHIAKI_ERR_SUCCESS)
|
||||
return MUNIT_ERROR;
|
||||
|
||||
munit_assert_memory_equal(sizeof(gmac), gmac, gmac_expected_high);
|
||||
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
||||
|
@ -290,7 +360,7 @@ static MunitResult test_gmac_multiple_of_key_refresh(const MunitParameter params
|
|||
0xbe, 0xfd, 0xee };
|
||||
|
||||
static const uint8_t crypt_index = 3;
|
||||
static const size_t key_pos = 0x6b1de0; // % CHIAKI_GKCRYPT_GMAC_KEY_REFRESH_KEY_POS == 0
|
||||
static const uint64_t key_pos = 0x6b1de0; // % CHIAKI_GKCRYPT_GMAC_KEY_REFRESH_KEY_POS == 0
|
||||
static const uint8_t gmac_expected[] = { 0x20, 0xcc, 0xa5, 0xf1 };
|
||||
|
||||
ChiakiLog log;
|
||||
|
|
|
@ -9,26 +9,51 @@ static MunitResult test_key_state(const MunitParameter params[], void *user)
|
|||
ChiakiKeyState state;
|
||||
chiaki_key_state_init(&state);
|
||||
|
||||
uint64_t pos = chiaki_key_state_request_pos(&state, 0);
|
||||
uint64_t pos = chiaki_key_state_request_pos(&state, 0, true);
|
||||
munit_assert_uint64(pos, ==, 0);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337, true);
|
||||
munit_assert_uint64(pos, ==, 0x1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff0000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff0000, true);
|
||||
munit_assert_uint64(pos, ==, 0xffff0000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337, true);
|
||||
munit_assert_uint64(pos, ==, 0x100001337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff1337, true);
|
||||
munit_assert_uint64(pos, ==, 0xffff1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x50000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x50000000, true);
|
||||
munit_assert_uint64(pos, ==, 0x150000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xb0000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xb0000000, true);
|
||||
munit_assert_uint64(pos, ==, 0x1b0000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x00000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x00000000, true);
|
||||
munit_assert_uint64(pos, ==, 0x200000000);
|
||||
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
||||
static MunitResult test_key_state_nocommit(const MunitParameter params[], void *user)
|
||||
{
|
||||
ChiakiKeyState state;
|
||||
chiaki_key_state_init(&state);
|
||||
|
||||
uint64_t pos = chiaki_key_state_request_pos(&state, 0, false);
|
||||
munit_assert_uint64(pos, ==, 0);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337, false);
|
||||
munit_assert_uint64(pos, ==, 0x1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff0000, false);
|
||||
munit_assert_uint64(pos, ==, 0xffff0000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x1337, false);
|
||||
munit_assert_uint64(pos, ==, 0x1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xffff1337, false);
|
||||
munit_assert_uint64(pos, ==, 0xffff1337);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x50000000, false);
|
||||
munit_assert_uint64(pos, ==, 0x50000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0xb0000000, false);
|
||||
munit_assert_uint64(pos, ==, 0xb0000000);
|
||||
pos = chiaki_key_state_request_pos(&state, 0x00000000, false);
|
||||
munit_assert_uint64(pos, ==, 0);
|
||||
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
||||
MunitTest tests_key_state[] = {
|
||||
{
|
||||
"/key_state",
|
||||
|
@ -38,5 +63,13 @@ MunitTest tests_key_state[] = {
|
|||
MUNIT_TEST_OPTION_NONE,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"/key_state_nocommit",
|
||||
test_key_state_nocommit,
|
||||
NULL,
|
||||
NULL,
|
||||
MUNIT_TEST_OPTION_NONE,
|
||||
NULL
|
||||
},
|
||||
{ NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
|
||||
};
|
||||
|
|
|
@ -28,9 +28,12 @@ static MunitResult test_av_packet_parse(const MunitParameter params[], void *use
|
|||
0x57, 0x5a, 0x76, 0x0, 0xc5, 0xe0, 0x93, 0xa9, 0xf5, 0x32, 0x5d, 0xee, 0xf7, 0x9d
|
||||
};
|
||||
|
||||
ChiakiKeyState key_state;
|
||||
chiaki_key_state_init(&key_state);
|
||||
|
||||
ChiakiTakionAVPacket av_packet;
|
||||
|
||||
ChiakiErrorCode err = chiaki_takion_v9_av_packet_parse(&av_packet, packet, sizeof(packet));
|
||||
ChiakiErrorCode err = chiaki_takion_v9_av_packet_parse(&av_packet, &key_state, packet, sizeof(packet));
|
||||
munit_assert_int(err, ==, CHIAKI_ERR_SUCCESS);
|
||||
|
||||
munit_assert(av_packet.is_video);
|
||||
|
|
52
test/takion_av_packet_parse_real_video.inl
generated
52
test/takion_av_packet_parse_real_video.inl
generated
|
@ -9,7 +9,9 @@ if(err != CHIAKI_ERR_SUCCESS)
|
|||
return MUNIT_ERROR;
|
||||
|
||||
|
||||
// -- frame --
|
||||
// -- frame -- ChiakiKeyState key_state;
|
||||
ChiakiKeyState key_state;
|
||||
chiaki_key_state_init(&key_state);
|
||||
|
||||
uint8_t packet_0[126]; size_t packet_0_size = sizeof(packet_0); if(chiaki_base64_decode("AgAAAAEAAAQBAwlCI7oAAACAA5gAhJT79yG83L9WhXCDP/h48VDjBL03cGscKH6DLQ3ZOzh007JcllEEIpTP3DbJwYAF5MGH2BwWJJTcbZATOGrzCznFMInIL7pWssSgxQBcf2q+u+vECFWQ5zvEQsq4RxQs3bre0DchyEMz", 168, packet_0, &packet_0_size) != CHIAKI_ERR_SUCCESS || packet_0_size != 126) return MUNIT_ERROR;
|
||||
uint8_t nalu_0[105]; size_t nalu_0_size = sizeof(nalu_0); if(chiaki_base64_decode("AAMAAAABZYiAhn8AL8gD/wh+/miASsv/rw5fm2PYQAAAAwAAAwAFIc42jXIHLchAAAe8A/i2oRmALiO8cB3sEzDosBxyZyFg4KK5rAXoBy0/2EfQAAADAAADAAADAAADAAADAAADAAJq", 140, nalu_0, &nalu_0_size) != CHIAKI_ERR_SUCCESS || nalu_0_size != 105) return MUNIT_ERROR;
|
||||
|
@ -17,7 +19,7 @@ uint8_t nalu_0[105]; size_t nalu_0_size = sizeof(nalu_0); if(chiaki_base64_decod
|
|||
|
||||
ChiakiTakionAVPacket av_packet_0;
|
||||
memset(&av_packet_0, 0, sizeof(av_packet_0));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_0, packet_0, sizeof(packet_0));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_0, &key_state, packet_0, sizeof(packet_0));
|
||||
munit_assert(av_packet_0.is_video);
|
||||
munit_assert_size(av_packet_0.data_size, ==, sizeof(nalu_0));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_0.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_0.data, av_packet_0.data_size);
|
||||
|
@ -30,7 +32,7 @@ uint8_t nalu_1[108]; size_t nalu_1_size = sizeof(nalu_1); if(chiaki_base64_decod
|
|||
|
||||
ChiakiTakionAVPacket av_packet_1;
|
||||
memset(&av_packet_1, 0, sizeof(av_packet_1));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_1, packet_1, sizeof(packet_1));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_1, &key_state, packet_1, sizeof(packet_1));
|
||||
munit_assert(av_packet_1.is_video);
|
||||
munit_assert_size(av_packet_1.data_size, ==, sizeof(nalu_1));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_1.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_1.data, av_packet_1.data_size);
|
||||
|
@ -43,7 +45,7 @@ uint8_t nalu_2[1400]; size_t nalu_2_size = sizeof(nalu_2); if(chiaki_base64_deco
|
|||
|
||||
ChiakiTakionAVPacket av_packet_2;
|
||||
memset(&av_packet_2, 0, sizeof(av_packet_2));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_2, packet_2, sizeof(packet_2));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_2, &key_state, packet_2, sizeof(packet_2));
|
||||
munit_assert(av_packet_2.is_video);
|
||||
munit_assert_size(av_packet_2.data_size, ==, sizeof(nalu_2));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_2.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_2.data, av_packet_2.data_size);
|
||||
|
@ -56,7 +58,7 @@ uint8_t nalu_3[12]; size_t nalu_3_size = sizeof(nalu_3); if(chiaki_base64_decode
|
|||
|
||||
ChiakiTakionAVPacket av_packet_3;
|
||||
memset(&av_packet_3, 0, sizeof(av_packet_3));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_3, packet_3, sizeof(packet_3));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_3, &key_state, packet_3, sizeof(packet_3));
|
||||
munit_assert(av_packet_3.is_video);
|
||||
munit_assert_size(av_packet_3.data_size, ==, sizeof(nalu_3));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_3.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_3.data, av_packet_3.data_size);
|
||||
|
@ -69,7 +71,7 @@ uint8_t nalu_4[1400]; size_t nalu_4_size = sizeof(nalu_4); if(chiaki_base64_deco
|
|||
|
||||
ChiakiTakionAVPacket av_packet_4;
|
||||
memset(&av_packet_4, 0, sizeof(av_packet_4));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_4, packet_4, sizeof(packet_4));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_4, &key_state, packet_4, sizeof(packet_4));
|
||||
munit_assert(av_packet_4.is_video);
|
||||
munit_assert_size(av_packet_4.data_size, ==, sizeof(nalu_4));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_4.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_4.data, av_packet_4.data_size);
|
||||
|
@ -82,7 +84,7 @@ uint8_t nalu_5[139]; size_t nalu_5_size = sizeof(nalu_5); if(chiaki_base64_decod
|
|||
|
||||
ChiakiTakionAVPacket av_packet_5;
|
||||
memset(&av_packet_5, 0, sizeof(av_packet_5));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_5, packet_5, sizeof(packet_5));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_5, &key_state, packet_5, sizeof(packet_5));
|
||||
munit_assert(av_packet_5.is_video);
|
||||
munit_assert_size(av_packet_5.data_size, ==, sizeof(nalu_5));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_5.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_5.data, av_packet_5.data_size);
|
||||
|
@ -95,7 +97,7 @@ uint8_t nalu_6[1339]; size_t nalu_6_size = sizeof(nalu_6); if(chiaki_base64_deco
|
|||
|
||||
ChiakiTakionAVPacket av_packet_6;
|
||||
memset(&av_packet_6, 0, sizeof(av_packet_6));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_6, packet_6, sizeof(packet_6));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_6, &key_state, packet_6, sizeof(packet_6));
|
||||
munit_assert(av_packet_6.is_video);
|
||||
munit_assert_size(av_packet_6.data_size, ==, sizeof(nalu_6));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_6.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_6.data, av_packet_6.data_size);
|
||||
|
@ -108,7 +110,7 @@ uint8_t nalu_7[1400]; size_t nalu_7_size = sizeof(nalu_7); if(chiaki_base64_deco
|
|||
|
||||
ChiakiTakionAVPacket av_packet_7;
|
||||
memset(&av_packet_7, 0, sizeof(av_packet_7));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_7, packet_7, sizeof(packet_7));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_7, &key_state, packet_7, sizeof(packet_7));
|
||||
munit_assert(av_packet_7.is_video);
|
||||
munit_assert_size(av_packet_7.data_size, ==, sizeof(nalu_7));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_7.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_7.data, av_packet_7.data_size);
|
||||
|
@ -121,7 +123,7 @@ uint8_t nalu_8[172]; size_t nalu_8_size = sizeof(nalu_8); if(chiaki_base64_decod
|
|||
|
||||
ChiakiTakionAVPacket av_packet_8;
|
||||
memset(&av_packet_8, 0, sizeof(av_packet_8));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_8, packet_8, sizeof(packet_8));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_8, &key_state, packet_8, sizeof(packet_8));
|
||||
munit_assert(av_packet_8.is_video);
|
||||
munit_assert_size(av_packet_8.data_size, ==, sizeof(nalu_8));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_8.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_8.data, av_packet_8.data_size);
|
||||
|
@ -134,7 +136,7 @@ uint8_t nalu_9[1351]; size_t nalu_9_size = sizeof(nalu_9); if(chiaki_base64_deco
|
|||
|
||||
ChiakiTakionAVPacket av_packet_9;
|
||||
memset(&av_packet_9, 0, sizeof(av_packet_9));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_9, packet_9, sizeof(packet_9));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_9, &key_state, packet_9, sizeof(packet_9));
|
||||
munit_assert(av_packet_9.is_video);
|
||||
munit_assert_size(av_packet_9.data_size, ==, sizeof(nalu_9));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_9.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_9.data, av_packet_9.data_size);
|
||||
|
@ -147,7 +149,7 @@ uint8_t nalu_10[1400]; size_t nalu_10_size = sizeof(nalu_10); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_10;
|
||||
memset(&av_packet_10, 0, sizeof(av_packet_10));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_10, packet_10, sizeof(packet_10));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_10, &key_state, packet_10, sizeof(packet_10));
|
||||
munit_assert(av_packet_10.is_video);
|
||||
munit_assert_size(av_packet_10.data_size, ==, sizeof(nalu_10));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_10.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_10.data, av_packet_10.data_size);
|
||||
|
@ -160,7 +162,7 @@ uint8_t nalu_11[11]; size_t nalu_11_size = sizeof(nalu_11); if(chiaki_base64_dec
|
|||
|
||||
ChiakiTakionAVPacket av_packet_11;
|
||||
memset(&av_packet_11, 0, sizeof(av_packet_11));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_11, packet_11, sizeof(packet_11));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_11, &key_state, packet_11, sizeof(packet_11));
|
||||
munit_assert(av_packet_11.is_video);
|
||||
munit_assert_size(av_packet_11.data_size, ==, sizeof(nalu_11));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_11.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_11.data, av_packet_11.data_size);
|
||||
|
@ -173,7 +175,7 @@ uint8_t nalu_12[1400]; size_t nalu_12_size = sizeof(nalu_12); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_12;
|
||||
memset(&av_packet_12, 0, sizeof(av_packet_12));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_12, packet_12, sizeof(packet_12));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_12, &key_state, packet_12, sizeof(packet_12));
|
||||
munit_assert(av_packet_12.is_video);
|
||||
munit_assert_size(av_packet_12.data_size, ==, sizeof(nalu_12));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_12.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_12.data, av_packet_12.data_size);
|
||||
|
@ -186,7 +188,7 @@ uint8_t nalu_13[10]; size_t nalu_13_size = sizeof(nalu_13); if(chiaki_base64_dec
|
|||
|
||||
ChiakiTakionAVPacket av_packet_13;
|
||||
memset(&av_packet_13, 0, sizeof(av_packet_13));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_13, packet_13, sizeof(packet_13));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_13, &key_state, packet_13, sizeof(packet_13));
|
||||
munit_assert(av_packet_13.is_video);
|
||||
munit_assert_size(av_packet_13.data_size, ==, sizeof(nalu_13));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_13.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_13.data, av_packet_13.data_size);
|
||||
|
@ -199,7 +201,7 @@ uint8_t nalu_14[1378]; size_t nalu_14_size = sizeof(nalu_14); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_14;
|
||||
memset(&av_packet_14, 0, sizeof(av_packet_14));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_14, packet_14, sizeof(packet_14));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_14, &key_state, packet_14, sizeof(packet_14));
|
||||
munit_assert(av_packet_14.is_video);
|
||||
munit_assert_size(av_packet_14.data_size, ==, sizeof(nalu_14));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_14.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_14.data, av_packet_14.data_size);
|
||||
|
@ -212,7 +214,7 @@ uint8_t nalu_15[1353]; size_t nalu_15_size = sizeof(nalu_15); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_15;
|
||||
memset(&av_packet_15, 0, sizeof(av_packet_15));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_15, packet_15, sizeof(packet_15));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_15, &key_state, packet_15, sizeof(packet_15));
|
||||
munit_assert(av_packet_15.is_video);
|
||||
munit_assert_size(av_packet_15.data_size, ==, sizeof(nalu_15));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_15.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_15.data, av_packet_15.data_size);
|
||||
|
@ -225,7 +227,7 @@ uint8_t nalu_16[1332]; size_t nalu_16_size = sizeof(nalu_16); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_16;
|
||||
memset(&av_packet_16, 0, sizeof(av_packet_16));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_16, packet_16, sizeof(packet_16));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_16, &key_state, packet_16, sizeof(packet_16));
|
||||
munit_assert(av_packet_16.is_video);
|
||||
munit_assert_size(av_packet_16.data_size, ==, sizeof(nalu_16));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_16.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_16.data, av_packet_16.data_size);
|
||||
|
@ -238,7 +240,7 @@ uint8_t nalu_17[1357]; size_t nalu_17_size = sizeof(nalu_17); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_17;
|
||||
memset(&av_packet_17, 0, sizeof(av_packet_17));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_17, packet_17, sizeof(packet_17));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_17, &key_state, packet_17, sizeof(packet_17));
|
||||
munit_assert(av_packet_17.is_video);
|
||||
munit_assert_size(av_packet_17.data_size, ==, sizeof(nalu_17));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_17.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_17.data, av_packet_17.data_size);
|
||||
|
@ -254,7 +256,7 @@ uint8_t nalu_18[575]; size_t nalu_18_size = sizeof(nalu_18); if(chiaki_base64_de
|
|||
|
||||
ChiakiTakionAVPacket av_packet_18;
|
||||
memset(&av_packet_18, 0, sizeof(av_packet_18));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_18, packet_18, sizeof(packet_18));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_18, &key_state, packet_18, sizeof(packet_18));
|
||||
munit_assert(av_packet_18.is_video);
|
||||
munit_assert_size(av_packet_18.data_size, ==, sizeof(nalu_18));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_18.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_18.data, av_packet_18.data_size);
|
||||
|
@ -267,7 +269,7 @@ uint8_t nalu_19[1400]; size_t nalu_19_size = sizeof(nalu_19); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_19;
|
||||
memset(&av_packet_19, 0, sizeof(av_packet_19));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_19, packet_19, sizeof(packet_19));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_19, &key_state, packet_19, sizeof(packet_19));
|
||||
munit_assert(av_packet_19.is_video);
|
||||
munit_assert_size(av_packet_19.data_size, ==, sizeof(nalu_19));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_19.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_19.data, av_packet_19.data_size);
|
||||
|
@ -280,7 +282,7 @@ uint8_t nalu_20[1328]; size_t nalu_20_size = sizeof(nalu_20); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_20;
|
||||
memset(&av_packet_20, 0, sizeof(av_packet_20));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_20, packet_20, sizeof(packet_20));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_20, &key_state, packet_20, sizeof(packet_20));
|
||||
munit_assert(av_packet_20.is_video);
|
||||
munit_assert_size(av_packet_20.data_size, ==, sizeof(nalu_20));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_20.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_20.data, av_packet_20.data_size);
|
||||
|
@ -293,7 +295,7 @@ uint8_t nalu_21[1313]; size_t nalu_21_size = sizeof(nalu_21); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_21;
|
||||
memset(&av_packet_21, 0, sizeof(av_packet_21));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_21, packet_21, sizeof(packet_21));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_21, &key_state, packet_21, sizeof(packet_21));
|
||||
munit_assert(av_packet_21.is_video);
|
||||
munit_assert_size(av_packet_21.data_size, ==, sizeof(nalu_21));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_21.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_21.data, av_packet_21.data_size);
|
||||
|
@ -306,7 +308,7 @@ uint8_t nalu_22[1331]; size_t nalu_22_size = sizeof(nalu_22); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_22;
|
||||
memset(&av_packet_22, 0, sizeof(av_packet_22));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_22, packet_22, sizeof(packet_22));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_22, &key_state, packet_22, sizeof(packet_22));
|
||||
munit_assert(av_packet_22.is_video);
|
||||
munit_assert_size(av_packet_22.data_size, ==, sizeof(nalu_22));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_22.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_22.data, av_packet_22.data_size);
|
||||
|
@ -319,7 +321,7 @@ uint8_t nalu_23[1307]; size_t nalu_23_size = sizeof(nalu_23); if(chiaki_base64_d
|
|||
|
||||
ChiakiTakionAVPacket av_packet_23;
|
||||
memset(&av_packet_23, 0, sizeof(av_packet_23));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_23, packet_23, sizeof(packet_23));
|
||||
chiaki_takion_v9_av_packet_parse(&av_packet_23, &key_state, packet_23, sizeof(packet_23));
|
||||
munit_assert(av_packet_23.is_video);
|
||||
munit_assert_size(av_packet_23.data_size, ==, sizeof(nalu_23));
|
||||
chiaki_gkcrypt_decrypt(&gkcrypt, av_packet_23.key_pos + CHIAKI_GKCRYPT_BLOCK_SIZE, av_packet_23.data, av_packet_23.data_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue