In [1]:
INIT0 = 0x736f6d6570736575 INIT1 = 0x646f72616e646f6d INIT2 = 0x6c7967656e657261 INIT3 = 0x7465646279746573
In [2]:
def sip_round(buf): assert len(buf) == 32 v0 = buf[0:8] v1 = buf[8:16] v2 = buf[16:24] v3 = buf[24:32] assert len(v0) == 8 assert len(v1) == 8 assert len(v2) == 8 assert len(v3) == 8 return buf
In [3]:
buf = b"Yor Mama" * 4 print(buf.hex()) buf = sip_round(buf) print(buf.hex())
Out:
596f72204d616d61596f72204d616d61596f72204d616d61596f72204d616d61 596f72204d616d61596f72204d616d61596f72204d616d61596f72204d616d61
Useful resources
https://cr.yp.to/siphash/siphash-20120918.pdf