The bit string must be of even length, so it can be split into two bit strings a and b of equal lengths, each of n bits. To compute the transform, a' and b', from these we use the equations:
To reverse this, clearly:
The above equations can be expressed in matrix algebra, by considering a and b as two elements of a vector, and the transform itself as multiplication by a matrix of the form:
The inverse can then be derived by inverting the matrix.
However, the matrix can be generalised to higher dimensions, allowing vectors of any power-of-two size to be transformed, using the following recursive rule:
- James Massey, "On the Optimality of SAFER+ Diffusion", 2nd AES Conference, 1999. 
- Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall, "Twofish: A 128-Bit Block Cipher", 1998. 
- Helger Lipmaa. On Differential Properties of Pseudo-Hadamard Transform and Related Mappings. INDOCRYPT 2002, LNCS 2551, pp 48-61, 2002.
|This cryptography-related article is a stub. You can help Wikipedia by expanding it.|