Closed TamtamHero closed 3 years ago
(Imported from Gitea, Author: p-col)
Just found that those two arrays in stellar_parser.c
static const uint8_t NETWORK_ID_PUBLIC_HASH[64] = { 0x7a, 0xc3, 0x39, 0x97, 0x54, 0x4e, 0x31, 0x75, 0xd2, 0x66, 0xbd, 0x02, 0x24, 0x39, 0xb2, 0x2c, 0xdb, 0x16, 0x50, 0x8c, 0x01, 0x16, 0x3f, 0x26, 0xe5, 0xcb, 0x2a, 0x3e, 0x10, 0x45, 0xa9, 0x79};
static const uint8_t NETWORK_ID_TEST_HASH[64] = { 0xce, 0xe0, 0x30, 0x2d, 0x59, 0x84, 0x4d, 0x32, 0xbd, 0xca, 0x91, 0x5c, 0x82, 0x03, 0xdd, 0x44, 0xb3, 0x3f, 0xbb, 0x7e, 0xdc, 0x19, 0x05, 0x1e, 0xa3, 0x7a, 0xbe, 0xdf, 0x28, 0xec, 0xd4, 0x72};
They both are 32 bytes long but still declared as 64 uint8_t.
Is there any reason for this?
JB: Hashes have been introduced in commit c65a2f67ad
They have been moved in several places since then, but nobody noticed the incorrect size :) Can be truncated to 32 bytes without any problem.
(Imported from Gitea, Author: p-col)
Just found that those two arrays in stellar_parser.c
static const uint8_t NETWORK_ID_PUBLIC_HASH[64] = { 0x7a, 0xc3, 0x39, 0x97, 0x54, 0x4e, 0x31, 0x75, 0xd2, 0x66, 0xbd, 0x02, 0x24, 0x39, 0xb2, 0x2c, 0xdb, 0x16, 0x50, 0x8c, 0x01, 0x16, 0x3f, 0x26, 0xe5, 0xcb, 0x2a, 0x3e, 0x10, 0x45, 0xa9, 0x79};
static const uint8_t NETWORK_ID_TEST_HASH[64] = { 0xce, 0xe0, 0x30, 0x2d, 0x59, 0x84, 0x4d, 0x32, 0xbd, 0xca, 0x91, 0x5c, 0x82, 0x03, 0xdd, 0x44, 0xb3, 0x3f, 0xbb, 0x7e, 0xdc, 0x19, 0x05, 0x1e, 0xa3, 0x7a, 0xbe, 0xdf, 0x28, 0xec, 0xd4, 0x72};
They both are 32 bytes long but still declared as 64 uint8_t.
Is there any reason for this?
JB: Hashes have been introduced in commit c65a2f67ad
They have been moved in several places since then, but nobody noticed the incorrect size :) Can be truncated to 32 bytes without any problem.