For a cryptographic hash function (a mathematical algorithm), a MASH-1 (Modular Arithmetic Secure Hash) is a hash function based on modular arithmetic.
Despite many proposals, few hash functions based on modular arithmetic have withstood attack, and most that have tend to be relatively inefficient. MASH-1 evolved from a long line of related proposals successively broken and repaired.
Committee Draft ISO/IEC 10118-4 (Nov 95)
MASH-1 involves use of an RSA-like modulus
N
N
N
Let
L
N
L
L<|N|\leqL+16
The message is padded by appending the message length and is separated into blocks
D1, … ,Dq
L/2
Di
Bi
L
Di
H0=IV
Hi=f(Bi,Hi-1)=((((Bi ⊕ Hi-1)\veeE)e\bmodN)\bmod2L) ⊕ Hi-1; i=1, … ,q
Where
E=15 ⋅ 2L-4
e=2
\vee
⊕
From
Hq
Dq+1, … ,Dq+8
\|
Hq=Y1\|Y3\|Y0\|Y2; |Yi|=L/4
Yi=Yi-1 ⊕ Yi-4; i=4, … ,15
Dq+i=Y2i-2\|Y2i-1; i=1, … ,8
These data blocks are now enlarged to
Bq+1, … ,Bq+8
Hi=f(Bi,Hi-1); i=q+1, … ,q+8
Finally the hash value is
Hq+8\bmodp
p
7 ⋅ 2L/2-3<p<2L/2
There is a newer version of the algorithm called MASH-2 with a different exponent. The original
e=2
e=28+1