ArticleslgStudy

mathematics

SWIFFT

SWIFFT 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 SWIFFT rather than just read about it. In short: In cryptography, SWIFFT is a collection of provably secure hash functions. It is based on the concept of the fast Fourier transform (FFT).

Key takeaways

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

Reference excerpt

In cryptography, SWIFFT is a collection of provably secure hash functions. It is based on the concept of the fast Fourier transform (FFT). SWIFFT is not the first hash function based on the FFT, but it sets itself apart by providing a mathematical proof of its security. It can be shown that finding collisions in SWIFFT is at least as difficult as finding short vectors in cyclic/ideal lattices in the worst case. By giving a security reduction to the worst case of a difficult mathematical problem, SWIFFT gives a much stronger security guarantee than most other cryptographic hash functions. Unlike many other provably secure hash functions, the algorithm is quite fast, yielding a throughput of 40 Mbit/s on a 3.2 GHz Intel Pentium 4. Although SWIFFT satisfies many desirable cryptographic and statistical properties, it was not designed to be an "all-purpose" cryptographic hash function. For example, it is not a pseudorandom function, and would not be a suitable instantiation of a random oracle. The algorithm is less efficient than most traditional hash functions that do not give a proof of their collision-resistance. Therefore, its practical use would lie mostly in applications where the proof of collision-resistance is particularly valuable, such as digital signatures that must remain trustworthy for a long time. A modification of SWIFFT called SWIFFTX was proposed as a candidate for SHA-3 function to the NIST hash function competition and was rejected in the first round.

The algorithm The algorithm is as follows:

Let the polynomial variable be called α. Input: message M of length mn Convert M to a collection of polynomials p1, …, pm in a certain polynomial ring R with binary coefficients. Compute the Fourier coefficients of each pi using SWIFFT. Define the Fourier coefficients of ai, so that they are fixed and depend on a family of SWIFFT. Point-wise multiply the Fourier coefficients pi with the Fourier coefficients of ai for each i. Use inverse FFT to obtain m polynomials fi of degree < 2n. Compute f=∑i=1m(fi) modulo p and αn + 1. Convert f to n log(p) bits and output it. The FFT operation in step 4 is easy to invert, and is performed to achieve diffusion, that is, to mix the input bits. The linear combination in step 6 achieves confusion, since it compresses the input. This is just a high level description of what the algorithm does, some more advanced optimizations are used to finally yield a high performing algorithm.

Example Assuming the parameters (n, m, p) = (64, 16, 257), any fixed compression function in the family takes a binary input of length mn = 1024 bits (128 bytes) to an output in the range ℤnp, which has size pn = 25764. An output in ℤnp can easily be represented using 528 bits (66 bytes).

Algebraic description The SWIFFT functions can be described as a simple algebraic expression over some polynomial ring R. A family of these functions depends on three main parameters: let n be a power of 2, let m > 0 be a small integer, and let p > 0 be a modulus (not necessarily prime, but is convenient to choose it prime). Define R to be the ring R = ℤp[α]/(αn + 1), i.e., the ring of polynomials in α having integer coefficients, modulo p and αn + 1. An element of R can be written as a polynomial of degree < n having coefficients in ℤp. A certain function in the SWIFFT family is specified by m fixed elements a1, …, am ∈ R of the ring R, that are called multipliers. The function corresponds to the following formula over R:

∑i=1m(ai⋅xi) The x1, …, xm ∈ R are polynomials with binary coefficients, and corresponding to the binary input of length mn.

Computing the polynomial product To compute the above expression, the main problem is to compute the polynomial products ai ⋅ xi. A fast way to compute these products is given by the convolution theorem. This says that under certain restrictions, F {f ∗ g} = F {f} ⋅ F {g}, where F denotes the Fourier transform and ⋅ denotes the pointwise product. In the general case of the convolution theorem, ∗ does not denote multiplication but convolution. It can, however, be shown that polynomial multiplication is a convolution.

Fast Fourier transform The fast Fourier transform is used to find the Fourier coefficients of each polynomial, which are then multiplied point-wise with the respective Fourier coefficients of the other polynomial. The resulting coefficients are then transformed to a polynomial of degree < 2n using an inverse fast Fourier transform.

Number-theoretic transform Instead of the normal Fourier transform, SWIFFT uses the number-theoretic transform. The number-theoretic transform uses roots of unity in ℤp instead of complex roots of unity. In order for this to work, ℤp needs to be a finite field and primitive 2nth roots of unity need to exist in this field. This can be done by taking p prime such that 2n divides p − 1.

Parameter choice The parameters m, p, and n are subject to the following restrictions:

n must be a power of 2, p must be prime, p − 1 must be a multiple of 2n, and log(p) < m (otherwise the output will not be smaller than the input). A possible choice is (n,m,p) = (64,16,257), which achieves a throughput of about 40 Mbit/s, security of about 2106 operations for finding collisions, and a digest size of 512 bits.

Statistical properties Universal hashing. The SWIFFT family of functions is universal. This means that for any fixed distinct x and y, the probability (over the random choice of f from the family) that f(x) = f(y) is the inverse of the size of the range. Regularity. The SWIFFT family of compression functions is regular. A function f is said to be regular if, for an input x chosen uniformly at random from the domain, the output f(x) is distributed uniformly over the range. Randomness extractor. SWIFFT is a randomness extractor. For hash tables and related applications, it is usually desirable for the outputs of the hash function to be distributed uniformly (or as close to uniformly as possible), even when the inputs are not uniform. Hash functions that give such guarantees are known as randomness extractors, because they distill the non-uniform randomness of the input down to an (almost) uniformly distributed output. Formally, randomness extraction is actually a property of a family of functions, from which one function is chosen at random (and obliviously to the input).

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with SWIFFT

Start with the simplest possible case. Write down what SWIFFT 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 SWIFFT 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 SWIFFT 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 SWIFFT

In research
SWIFFT 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 SWIFFT 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
SWIFFT is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic hash functions, so understanding it makes those chapters shorter.
In everyday life
Look for SWIFFT 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 “SWIFFT” →

How to study SWIFFT in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what SWIFFT 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 SWIFFT out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is SWIFFT in simple terms?

In cryptography, SWIFFT is a collection of provably secure hash functions. It is based on the concept of the fast Fourier transform (FFT).

Why does SWIFFT 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 SWIFFT?

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 SWIFFT.

Tags

  • Cryptographic hash functions

Keep exploring