Exemplo n.º 1
0
 public function test_pack()
 {
     $ary = array(0xffffffff, 0xffffffff);
     $s = ints2string($ary);
     $this->assertEquals('ffffffffffffffff', bin2hex($s));
     $uints = string2ints($s);
     $this->assertEquals(2, count($uints));
     $this->assertEquals(0xffffffff, $uints[0]);
 }
Exemplo n.º 2
0
function salsa20_8_str($s)
{
    // convert string of 64 bytes to 16 32-bit integers
    $B32 = string2ints($s);
    salsa20($B32, 8);
    return ints2string($B32);
}