SipHash


Reading time: about 1 minute
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

The following pages link here

Citation

If you find this work useful, please cite it as:
@article{yaltirakliwikisiphash,
  title   = "SipHash",
  author  = "Yaltirakli, Gokberk",
  journal = "gkbrk.com",
  year    = "2024",
  url     = "https://www.gkbrk.com/wiki/siphash/"
}
Not using BibTeX? Click here for more citation styles.
IEEE Citation
Gokberk Yaltirakli, "SipHash", October, 2024. [Online]. Available: https://www.gkbrk.com/wiki/siphash/. [Accessed Oct. 19, 2024].
APA Style
Yaltirakli, G. (2024, October 19). SipHash. https://www.gkbrk.com/wiki/siphash/
Bluebook Style
Gokberk Yaltirakli, SipHash, GKBRK.COM (Oct. 19, 2024), https://www.gkbrk.com/wiki/siphash/

Comments

© 2024 Gokberk Yaltirakli