1 | <?php |
||
21 | * |
||
22 | * @see https://www.ietf.org/rfc/rfc3394.txt#4 |
||
23 | */ |
||
24 | final class One64BitBlockTest extends TestCase |
||
25 | { |
||
26 | public function testWrap64BitsKeyDataWith128BitKEK() |
||
36 | |||
37 | public function testWrap64BitsKeyDataWith192BitKEK() |
||
47 | |||
48 | public function testWrap64BitsKeyDataWith256BitKEK() |
||
49 | { |
||
50 | $kek = hex2bin('000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'); |
||
51 | $data = hex2bin('0011223344556677'); |
||
52 | |||
53 | $wrapped = A256KW::wrap($kek, $data); |
||
54 | $this->assertEquals(hex2bin('794314D454E3FDE1F661BD9F31FBFA31'), $wrapped); |
||
55 | $unwrapped = A256KW::unwrap($kek, $wrapped); |
||
56 | $this->assertEquals($data, $unwrapped); |
||
59 |