Badger is a Message Authentication Code (MAC) based on the idea of universal hashing and was developed by Boesgaard, Christensen, and Zenner. It is constructed by strengthening the ∆-universal hash family MMH using an ϵ-almost strongly universal (ASU) hash function family after the application of ENH (see below), where the value of ϵ is
Contents
Introduction
The Badger MAC processes a message of length up to
The key setup has to be run only once per key in order to run the Badger algorithm under a given key, since the resulting internal state of the MAC can be saved to be used with any other message that will be processed later.
ENH
Hash families can be combined in order to obtain new hash families. For the ϵ-AU, ϵ-A∆U, and ϵ-ASU families, the latter are contained in the former. For instance, an A∆U family is also an AU family, an ASU is also an A∆U family, and so forth. On the other hand, a stronger family can be reduced to a weaker one, as long as a performance gain can be reached. A method to reduce ∆-universal hash function to universal hash functions will be described in the following.
Theorem 2
Let
If
The ENH-family is constructed based on the universal hash family NH (which is also used in UMAC):
Where ‘
Lemma 1
The following version of NH is
Choosing w=32 and applying Theorem 1, one can obtain the
where all arguments are 32-bits long and the output has 64-bits.
Construction
Badger is constructed using the strongly universality hash family and can be described as
where an
Two steps on Badger
There are two steps that have to be executed for every message: processing phase and finalize phase.
Processing phase In this phase, the data is hashed to a 64-bit string. A core function
for any n,
A message can be processed by using this function. Denote level_key [j][i] by
Pseudo-code of the processing phase is as follow.
L=|M|if L=0M^1=⋯=M^u=0Go to finalizationr=L mod 64if r≠0:M=0^(64-r)∥Mfor i=1 to u:M^i=Mv^'=max{1,⌈log_2 L⌉-6}for j=1 to v^':divide M^i into 64-bit blocks, M^i=m_t^i∥⋯∥m_1^iif t is even:M^i=h(k_j^i,m_t^i,m_(t-1)^i )∥⋯∥h(k_j^i,m_2^i,m_1^i )elseM^i=m_t^i∥h(k_j^i,m_(t-1)^i,m_(t-2)^i )∥⋯∥h(k_j^i,m_2^i,m_1^i )Finalize phase In this phase, the 64-string resulting from the processing phase is transformed into the desired MAC tag. This finalization phase uses the Rabbit stream cipher and uses both key setup and IV setup by taking the finalization key final_key[j][i] as
Pseudo-code of the finalization phase
RabbitKeySetup(K)RabbitIVSetup(N)for i=1 to u:Q^i=0^7∥L∥M^idivide Q^i into 27-bit blocks, Q^i=q_5^i∥⋯∥q_1^iS^i=(∑_(j=1)^5 (q_j^i K_j^i))+K_6^i mod pS=S^u∥⋯∥S^1S=S ⨁ RabbitNextbit(u∙32)return SNotation:
From the pseudocode above, k denotes the key in the Rabbit Key Setup(K) which initializes Rabbit with the 128-bit key k. M denotes the message to be hashed and |M| denotes the length of the message in bits. q_i denotes a message M that is divided into i blocks. For the given 2n-bit string x then L(x) and U(x) respectively denoted its least significant n bits and most significant n bits.
Performance
Boesgard, Christensen and Zenner report the performance of Badger measured on a 1.0 GHz Pentium III and on a 1.7 GHz Pentium 4 processor. The speed-optimized versions were programmed in assembly language inlined in C and compiled using the Intel C++ 7.1 compiler.
The following table presents Badger's properties for various restricted message lengths. “Memory req.” denotes the amount of memory required to store the internal state including key material and the inner state of the Rabbit stream cipher . “Setup” denotes the key setup, and “Fin.” denotes finalization with IV-setup.
MMH (Multilinear Modular Hashing)
The name MMH stands for Multilinear-Modular-Hashing. Applications in Multimedia are for example to verify the integrity of an on-line multimedia title. The performance of MMH is based on the improved support of integer scalar products in modern microprocessors.
MMH uses single precision scalar products as its most basic operation. It consists of a (modified) inner product between the message and a key modulo a prime
MMH*
MMH* involves a construction of a family of hash functions consisting of multilinear functions on
where x, m are vectors, and the functions
In the case of MAC,
MMH* should satisfy the security requirements of a MAC, enabling say Ana and Bob to communicate in an authenticated way. They have a secret key
Assume that Charles knows that the function is of the form
Theorem 1:The family MMH* is ∆-universal.
Proof:
Take
To explain the theorem above, take
So, what one actually needs to compute is
But,
From the proof above,
MMH*32
Halevi and Krawczyk construct a variant called
where
The functions
where
By theorem 1, the collision probability is about ϵ =
The value of k
The value of k that describes the length of the message and key vectors has several effects:
Performance
Below are the timing results for various implementations of MMH in 1997, designed by Halevi and Krawczyk.