GO-V.ORG
As seen in

UMAC (cryptography)

In cryptography, a universal hashing message authentication code, or UMAC, is a message authentication code (MAC) calculated using universal hashing, which involves choosing a hash function from a class of hash functions according to some secret (random) process and applying it to the message.[src] The resulting digest or fingerprint is then encrypted to hide the identity of the hash function that was used.[src] A variation of the scheme was first published in 1999.[src] As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message.[src] In contrast to traditional MACs, which are serializable, a UMAC can be executed in parallel.[src] Thus, as machines continue to offer more parallel-processing capabilities, the speed of implementing UMAC can increase.[src] A specific type of UMAC, also commonly referred to just as "UMAC", is described in an informational RFC published as RFC 4418 in March 2006.[src] It has provable cryptographic strength and is usually substantially less computationally intensive than other MACs.[src] UMAC's design is optimized for 32-bit architectures with SIMD support, with a performance of 1 CPU cycle per byte (cpb) with SIMD and 2 cpb without SIMD.…[src]

In cryptography, a universal hashing message authentication code, or UMAC, is a message authentication code (MAC) calculated using universal hashing, which involves choosing a hash function from a class of hash functions according to some secret (random) process and applying it to the message.[src] The resulting digest or fingerprint is then encrypted to hide the identity of the hash function that was used.[src] A variation of the scheme was first published in 1999.[src] As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message.[src] In contrast to traditional MACs, which are serializable, a UMAC can be executed in parallel.[src] Thus, as machines continue to offer more parallel-processing capabilities, the speed of implementing UMAC can increase.[src] A specific type of UMAC, also commonly referred to just as "UMAC", is described in an informational RFC published as RFC 4418 in March 2006.[src] It has provable cryptographic strength and is usually substantially less computationally intensive than other MACs.[src] UMAC's design is optimized for 32-bit architectures with SIMD support, with a performance of 1 CPU cycle per byte (cpb) with SIMD and 2 cpb without SIMD.[src] A closely related variant of UMAC that is optimized for 64-bit architectures is given by VMAC, which was submitted to the IETF as a draft in April 2007 ( ) but never gathered enough attention to be approved as an RFC.[src] ===Universal hashing=== Let's say the hash function is chosen from a class of hash functions H, which maps messages into D, the set of possible message digests.[src] This class is called universal if, for any distinct pair of messages, there are at most |H|/|D| functions that map them to the same member of D.[src] This means that if an attacker wants to replace one message with another and, from his point of view, the hash function was chosen completely randomly, the probability that the UMAC will not detect his modification is at most 1/|D|.[src] But this definition is not strong enough — if the possible messages are 0 and 1, D={0,1} and H consists of the identity operation and not, H is universal.[src] But even if the digest is encrypted by modular addition, the attacker can change the message and the digest at the same time and the receiver wouldn't know the difference.[src] ===Strongly universal hashing=== A class of hash functions H that is good to use will make it difficult for an attacker to guess the correct digest d of a fake message f after intercepting one message a with digest c.[src] In other words, \Pr_{h \in H}[h(f)=d|h(a)=c]\, needs to be very small, preferably 1/|D|.[src] It is easy to construct a class of hash functions when D is field.[src] For example, if |D| is prime, all the operations are taken modulo |D|.[src] The message a is then encoded as an n-dimensional vector over .[src] H then has |D| n+1 members, each corresponding to an -dimensional vector over .[src] If we let h(a) = h_0 + \sum_{i=1}^n {h_i}{a_i} we can use the rules of probabilities and combinatorics to prove that \Pr_{h \in H}[h(f)=d|h(a)=c]={1 \over |D|} If we properly encrypt all the digests (e.g.[src] with a one-time pad), an attacker cannot learn anything from them and the same hash function can be used for all communication between the two parties.[src] This may not be true for ECB encryption because it may be quite likely that two messages produce the same hash value.[src] Then some kind of initialization vector should be used, which is often called the nonce.[src] It has become common practice to set h 0 = f(nonce), where f is also secret.[src] Notice that having massive amounts of computer power does not help the attacker at all.[src] If the recipient limits the amount of forgeries it accepts (by sleeping whenever it detects one), |D| can be 2 32 or smaller.[src] ===Example=== The following C function generates a 24 bit UMAC.[src] It assumes that secret is a multiple of 24 bits, msg is not longer than secret and result already contains the 24 secret bits e.g.[src] f(nonce).[src] nonce does not need to be contained in msg .[src] /* DUBIOUS: This does not seem to have anything to do with the (likely long) RFC * definition.[src] This is probably an example for the general UMAC concept.[src] * Who the heck from 2007 (Nroets) chooses 3 bytes in an example?[src] * * We gotta move this along with a better definition of str.[src] uni.[src] hash into * uni.[src] hash.[src] */ define uchar uint8_t void UHash24 (uchar *msg, uchar *secret, size_t len, uchar *result) { uchar r1 = 0, r2 = 0, r3 = 0, s1, s2, s3, byteCnt = 0, bitCnt, byte; while (len-- > 0) { /* Fetch new secret for every three bytes.[src] */ if (byteCnt-- == 0) { s1 = *secret++; s2 = *secret++; s3 = *secret++; byteCnt = 2; } byte = *msg++; /* Each byte of the msg controls whether a bit of the secrets make it into the hash.、 * * I don't get the point about keeping its order under 24, because with a 3-byte thing * it by definition only holds polynominals order 0-23.[src] The "sec" code have identical * behavior, although we are still doing a LOT of work for each bit */ for (uchar bitCnt = 0; bitCnt > 16) & 0xff */ r2 ^= s2; /* (sec >> 8) & 0xff */ r3 ^= s3; /* (sec ) & 0xff */ } byte >>= 1; /* next bit.[src] */ /* and multiply secret with x (i.e.[src] 2), subtracting (by XOR) the polynomial when necessary to keep its order under 24 (?!) */ uchar doSub = s3 & 0x80; s3 */ s1 ^= 0x1B; /* x^24 + x^4 + x^3 + x + 1 [16777243 -- not a prime] */ } } /* for each bit in the message */ } /* for each byte in the message */ *result++ ^= r1; *result++ ^= r2; *result++ ^= r3; } define uchar uint8_t define swap32(x) ((x) & 0xff) > 8 | (x) & 0xff000000) >> 24) /* This is the same thing, but grouped up (generating better assembly and stuff).[src] It is still bad and nobody has explained why it's strongly universal.[src] */ void UHash24Ex (uchar *msg, uchar *secret, size_t len, uchar *result) { uchar byte, read; uint32_t sec = 0, ret = 0, content = 0; while (len > 0) { /* Read three in a chunk.[src] */ content = 0; switch (read = (len >= 3 ?[src] 3 : len)) { case 2: content |= (uint32_t) msg[2] >= 1; /* next bit.[src] */ /* Shift register.[src] */ sec > 8) & 0xff; result[2] ^= (ret >> 16) & 0xff; } \operatorname{NH}_{K}(M) = \left( \sum_{i=0}^{ (n/2)-1 } ((m_{2i} + k_{2i}) \bmod ~ 2^w ) \cdot ((m_{2i+1} + k_{2i+1}) \bmod ~ 2^w ) \right) \bmod ~ 2^{2w} .[src] where The message M is encoded as an n-dimensional vector of w-bit words (m 0 , m 1 , m 2 , ..., m n-1 ).[src] The intermediate key K is encoded as an n+1-dimensional vector of w-bit words (k 0 , k 1 , k 2 , ..., k n ).[src] A pseudorandom generator generates K from a shared secret key.[src] Practically, NH is done in unsigned integers.[src] All multiplications are mod 2^w, all additions mod 2^w/2, and all inputs as are a vector of half-words ( w/2 = 32 -bit integers).[src] The algorithm will then use \lceil k/2 \rceil multiplications, where k was the number of half-words in the vector.[src] Thus, the algorithm runs at a "rate" of one multiplication per word of input.[src] Y = 0 for (i = 0; i \begin{align} \mathtt{Y} &= \mathtt{Y +_{64} ((M_{i+0} +_{32} K_{i+0}) *_{64} (M_{i+4} +_{32} K_{i+4}))} \\ \mathtt{Y} &= \mathtt{Y +_{64} ((M_{i+1} +_{32} K_{i+1}) *_{64} (M_{i+5} +_{32} K_{i+5}))} \\ \mathtt{Y} &= \mathtt{Y +_{64} ((M_{i+2} +_{32} K_{i+2}) *_{64} (M_{i+6} +_{32} K_{i+6}))} \\ \mathtt{Y} &= \mathtt{Y +_{64} ((M_{i+3} +_{32} K_{i+3}) *_{64} (M_{i+7} +_{32} K_{i+7}))} \end{align} end for This definition is designed to encourage programmers to use SIMD instructions on the accumulation, since only data with four indices away are likely to not be put in the same SIMD register, and hence faster to multiply in bulk.[src] On a hypothetical machine, it could simply translate to: movq $0, regY ; Y = 0 movq $0, regI ; i = 0 loop: add reg1, regM, regI ; reg1 = M + i add reg2, regM, regI vldr.4x32 vec1, reg1 ; load 4x32bit vals from memory *reg1 to vec1 vldr.4x32 vec2, reg2 vmul.4x64 vec3, vec1, vec2 ; vec3 = vec1 * vec2 uaddv.4x64 reg3, vec3 ; horizontally sum vec3 into reg3 add regY, regY, reg3 ; regY = regY + reg3 add regI, regI, $8 cmp regI, regT jlt loop ==See also== Poly1305, another fast MAC based on strongly universal hashing MMH-Badger MAC, another fast MAC ==References==[src]

68 sentences · 68 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"UMAC (cryptography)." encyclopegia.org, 2024, https://encyclopegia.org/wiki/umac-cryptography. Accessed 06 December 2026.

Chicago

"UMAC (cryptography)." encyclopegia.org. Accessed December 6, 2026. https://encyclopegia.org/wiki/umac-cryptography.

APA

encyclopegia.org. (2024). UMAC (cryptography). Retrieved December 6, 2026, from https://encyclopegia.org/wiki/umac-cryptography

Accessed December 6, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
publication date1999Wikipedia
publication date2006Wikipedia
members1 membersWikipedia

Related articles

Financial cryptography

stub · references available

elliptic curve cryptography

stub · references available

Public Key Cryptography Standards

stub · references available

Strong cryptography

stub · references available

Applied Cryptography and Network Security

stub · references available

Public Key Cryptography Standard 1

stub · references available

Template:Cryptography hash

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1262898815 · 0.5 · snapshot enwiki-001262898815

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.