ArticleslgStudy

mathematics

Sponge function

Sponge function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sponge function rather than just read about it. In short: In cryptography, a sponge function or sponge construction is any of a class of algorithms with finite internal state that take an input bit stream of any length and produce an output bit stream of any desired length. Sponge functions have both theoretical and practical uses.

Sponge function — main illustration
Sponge function — illustration

Key takeaways

  • Sponge function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sponge function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sponge function from memory before moving on to harder problems.

Reference excerpt

In cryptography, a sponge function or sponge construction is any of a class of algorithms with finite internal state that take an input bit stream of any length and produce an output bit stream of any desired length. Sponge functions have both theoretical and practical uses. They can be used to model or implement many cryptographic primitives, including cryptographic hashes, message authentication codes, mask generation functions, stream ciphers, pseudo-random number generators, and authenticated encryption.

Construction A sponge function is built from three components:

a state memory, S, containing b bits, a function f : { 0 , 1 } b → { 0 , 1 } b {\displaystyle f:\{0,1\}^{b}\rightarrow \{0,1\}^{b}}

a padding function P S is divided into two sections: one of size r (the bitrate) and the remaining part of size c (the capacity). These sections are denoted R and C respectively. f produces a pseudorandom permutation of the 2 b {\displaystyle 2^{b}} states from S. P appends enough bits to the input string so that the length of the padded input is a whole multiple of the bitrate, r. This means the input is segmented into blocks of r bits.

Operation The sponge function "absorbs" (in the sponge metaphor) all blocks of a padded input string as follows:

S is initialized to zero for each r-bit block B of P(string) R is replaced with R XOR B (using bitwise XOR) S is replaced by f(S) The sponge function output is now ready to be produced ("squeezed out") as follows:

repeat until output is full output the R portion of S S is replaced by f(S) If less than r bits remain to be output, then R will be truncated (only part of R will be output). Another metaphor describes the state memory as an "entropy pool", with input "poured into" the pool, and the transformation function referred to as "stirring the entropy pool". Note that input bits are never XORed into the C portion of the state memory, nor are any bits of C ever output directly. The extent to which C is altered by the input depends entirely on the transformation function f. In hash applications, resistance to collision or preimage attacks depends on C, and its size (the "capacity" c) is typically twice the desired resistance level.

Duplex construction It is also possible to absorb and squeeze in an alternating fashion. This operation is called the duplex construction or duplexing. It can be the basis of a single pass authenticated encryption system. This have also been used as an efficient variant of the Fiat-Shamir transformation for some protocols.

The state S is initialized to zero for each r-bit block B of the input R is XORed with B S is replaced by f(S) R is now an output block of size r bits.

Overwrite mode It is possible to omit the XOR operations during absorption, while still maintaining the chosen security level. In this mode, in the absorbing phase, the next block of the input overwrites the R part of the state. This allows keeping a smaller state between the steps. Since the R part will be overwritten anyway, it can be discarded in advance, only the C part must be kept.

Applications Sponge functions have both theoretical and practical uses. In theoretical cryptanalysis, a random sponge function is a sponge construction where f is a random permutation or transformation, as appropriate. Random sponge functions capture more of the practical limitations of cryptographic primitives than does the widely used random oracle model, in particular the finite internal state. The sponge construction can also be used to build practical cryptographic primitives. For example, the Keccak cryptographic sponge with a 1600-bit state has been selected by NIST as the winner in the SHA-3 competition. The strength of Keccak derives from the intricate, multi-round permutation f that its authors developed. The RC4-redesign called Spritz refers to the sponge-construct to define the algorithm. For other examples, a sponge function can be used to build authenticated encryption with associated data (AEAD), as well as password hashing schemes.

References

External links

Illustrations

Sponge function: The sponge construction for hash functions. Pi are blocks of the input string, Zi are hashed output blocks.
The sponge construction for hash functions. Pi are blocks of the input string, Zi are hashed output blocks.

Worked examples

Example 1 — a first encounter with Sponge function

Start with the simplest possible case. Write down what Sponge function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sponge function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sponge function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sponge function

In research
Sponge function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sponge function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sponge function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic hash functions, Theory of cryptography, so understanding it makes those chapters shorter.
In everyday life
Look for Sponge function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sponge function” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sponge function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sponge function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sponge function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sponge function in simple terms?

In cryptography, a sponge function or sponge construction is any of a class of algorithms with finite internal state that take an input bit stream of any length and produce an output bit stream of any desired length. Sponge functions have both theoretical and practical uses.

Why does Sponge function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sponge function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sponge function.

Tags

  • Cryptographic hash functions
  • Theory of cryptography

Keep exploring