mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
encoding fail test
This commit is contained in:
parent
f498fabd27
commit
0e666e7d6a
|
@ -58,6 +58,12 @@ const uint8_t key3[32] =
|
||||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55
|
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const uint8_t failed_key[32] =
|
||||||
|
{
|
||||||
|
0xe6, 0xf6, 0x6f, 0xdf, 0x6e, 0x23, 0x0c, 0x60, 0x3c, 0x5e, 0x6e, 0x59, 0xa2, 0x54, 0xea, 0x14,
|
||||||
|
0x76, 0xa1, 0x3e, 0xb9, 0x51, 0x1b, 0x95, 0x49, 0x84, 0x67, 0x81, 0xe1, 0x2e, 0x52, 0x23, 0x0a
|
||||||
|
};
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
uint8_t buf[32];
|
uint8_t buf[32];
|
||||||
|
@ -74,4 +80,6 @@ int main ()
|
||||||
assert(memcmp (buf, key2, 32) == 0);
|
assert(memcmp (buf, key2, 32) == 0);
|
||||||
el.Decode (encoded3, buf);
|
el.Decode (encoded3, buf);
|
||||||
assert(memcmp (buf, key3, 32) == 0);
|
assert(memcmp (buf, key3, 32) == 0);
|
||||||
|
// encoding fails
|
||||||
|
assert (!el.Encode (failed_key, buf));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue