Improve explanation of the XXTEA algorithm
This commit is contained in:
parent
21ed995281
commit
d4ed30a592
20
puer.c
20
puer.c
|
@ -25,16 +25,18 @@ void xxtea128(uint32_t const key[4], uint32_t block[4]) {
|
||||||
// key accesses, since key is only 4 words long
|
// key accesses, since key is only 4 words long
|
||||||
//
|
//
|
||||||
// 3. Go through each word in the block and derive its new
|
// 3. Go through each word in the block and derive its new
|
||||||
// value based on next (y) and previous word (z),
|
// value based on its current value (v[p]), the next (y)
|
||||||
// wrapping around as needed, as well as the round
|
// and the previous word (z), wrapping around the ends
|
||||||
// constant(s) and the key.
|
// of the block as needed.
|
||||||
//
|
//
|
||||||
// The function for deriving the new value of a block is a
|
// The function for deriving the new value of a word is a
|
||||||
// xor of sums of xors. The first sum adds together
|
// xor of sums of xors, followed by an in-place addition.
|
||||||
// combinations of the next and previous block, and the
|
// The first sum adds together combinations of the next and
|
||||||
// second sum adds together previous/bext combined with a
|
// previous word, and the second sum adds together
|
||||||
// value dependant on the round constant. The key is also
|
// previous/next combined with a value dependant on the
|
||||||
// mixed into the block in the first xor of second sum.
|
// round constant. The key is also mixed into the word in
|
||||||
|
// the first xor of second sum. After this the result is
|
||||||
|
// added back into the original word.
|
||||||
//
|
//
|
||||||
// I have changed the operand order in the second xor of
|
// I have changed the operand order in the second xor of
|
||||||
// first add and in the second add. This is to keep the
|
// first add and in the second add. This is to keep the
|
||||||
|
|
Loading…
Reference in New Issue