pub fn encrypt_block<W: Word>(
expanded_key: &[W],
block: [W; 2],
) -> Result<[W; 2], Error>Expand description
Block Encryption
We assume that the input block is given in two w-bit registers A and B. We also assume that key-expansion has already been performed, so that the array S[0…t−1] has been computed. Here is the encryption algorithm in pseudo-code:
A = A + S[0]; B = B + S[1]; for i = 1 to r do A = ((A ⊕ B) < B) + S[2 ∗ i]; B = ((B ⊕ A) < A) + S[2 ∗ i + 1]; end for
The output is in the registers A and B.