mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
fix: operations inside macro expansion
This commit is contained in:
parent
9cdb50a5a8
commit
2a6be74fd1
1 changed files with 9 additions and 4 deletions
|
@ -84,10 +84,15 @@ void transform_D(uint8_t *ru) {
|
|||
uint32_t v1 = ((ru[3] << 24) | (ru[2] << 16) | (ru[1] << 8) | ru[0]) + c_D[p++];
|
||||
uint32_t v2 = ((ru[7] << 24) | (ru[6] << 16) | (ru[5] << 8) | ru[4]) + c_D[p++];
|
||||
for (i = 0; i < 12; i += 2) {
|
||||
uint32_t t1 = ROTL(v1 ^ v2, v2 & 0x1F) + c_D[p++];
|
||||
uint32_t t2 = ROTL(v2 ^ t1, t1 & 0x1F) + c_D[p++];
|
||||
v1 = ROTL(t1 ^ t2, t2 & 0x1F) + c_D[p++];
|
||||
v2 = ROTL(t2 ^ v1, v1 & 0x1F) + c_D[p++];
|
||||
|
||||
uint32_t xor1 = v1 ^ v2;
|
||||
uint32_t t1 = ROTL(xor1, v2 & 0x1F) + c_D[p++];
|
||||
uint32_t xor2 = v2 ^ t1;
|
||||
uint32_t t2 = ROTL(xor2, t1 & 0x1F) + c_D[p++];
|
||||
uint32_t xor3 = t1 ^ t2;
|
||||
uint32_t xor4 = t2 ^ v1;
|
||||
v1 = ROTL(xor3, t2 & 0x1F) + c_D[p++];
|
||||
v2 = ROTL(xor4, v1 & 0x1F) + c_D[p++];
|
||||
}
|
||||
|
||||
//Re-use ru
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue