From 8cb1b07fd9d46d55c8308d0d98efb7ed9bb23078 Mon Sep 17 00:00:00 2001 From: Logan oos Even <46396513+Logan007@users.noreply.github.com> Date: Thu, 7 Jan 2021 22:12:41 +0545 Subject: [PATCH] updated section on hashing ...according to latest code changes --- doc/Crypto.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Crypto.md b/doc/Crypto.md index ca5456b..74cce22 100644 --- a/doc/Crypto.md +++ b/doc/Crypto.md @@ -68,13 +68,13 @@ Throughout n2n, pseudo-random numbers are generated for several purposes, e.g. r Its initialization relies on seeding with a value as random as possible. Various sources are tapped including a syscall to Linux' `SYS_getrandom` as well as Intels hardware random number generators `RDRND` and `RDSEED`, if available (compile using `-march=native`). -### Pearson Hashing +### Pearson Block Hashing -For general purpose hashing, n2n employs Pearson hashing as it offers variable hash sizes and is said not to be too "collidy". However, this is not a cryptographically secure hashing function which by the way is not required here: The hashing is never applied in a way that the hash shall prove the knowledge of a secret without showing the secret. +For general purpose hashing, n2n employs [Pearson Block Hashing](https://github.com/Logan007/pearsonB) as it offers variable hash sizes and is said not to be too "collidy". However, this is not a cryptographically secure hashing function which by the way is not required here: The hashing is never applied in a way that the hash value shall publically prove the knowledge of a secret without showing the secret itself. -_Pearson hashing is tweakable by making your own permutation of the 256 byte table._ Here, the AES' s-box is used: Given appropriate hardware, a lookup could even be accelerated. +_Pearson hashing is tweakable by using your own block-sized permutation._ Here, we use a three-round xor-rotate-multiply permutation scheme on 64-bit wide integer numbers with constants discovered by [David Stafford](http://zimbry.blogspot.com/2011/09/better-bit-mixing-improving-on.html) (`mix13`) permission obtained via eMail) which, these days, is better known as part of `splitmix64()`. -_Pearson hashing allows verification of parts of the hash only – just in case performance requirements would urge to do so._ +_Pearson hashing allows verification of block-sized parts of the hash only – just in case performance requirements would urge to do so._ ## Header