🏷️Sponge function
- 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.
- 🖇️cf. SHA-3는 keccak-f 순열을 기반으로 한다.
📌Operation
- A sponge function is built from three components
- S: state memory containing b bits,
- S is divided into two sections:
- R: the bitrate, one of size r
- C: the capacity, the remaining part of size c
- f: permutation function (가역적)
- P: a padding function
- 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.
- Since C is confidential, do not perform XOR operations on C.
absorbing
- S(
= R + C
) is initialized to zero
- for each r-bit block B of P(string)
- R is replaced with
R XOR B
- S is replaced by f(S)
squeezing
- The sponge function output is now ready to be produced "squeezed out".
- repeat
- output the R portion of S
- S is replaced by f(S) unless output is full
- If less than r bits remain to be output, then R will be truncated (only part of R will be output).