Skip to content

Commit

Permalink
reverse bytes using pointer instead of array notation
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-szabo committed Apr 2, 2024
1 parent 300d244 commit 2e95aa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yhunwrap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ static bool unwrap_data(uint8_t *key, size_t key_len, uint8_t *in, size_t in_len
uint8_t temp;
int i;
for (i = 0; i < 16; i++) {
temp = out[OBJECT_HEADER_SIZE + i];
out[OBJECT_HEADER_SIZE + i] = out[OBJECT_HEADER_SIZE + 31 - i];
out[OBJECT_HEADER_SIZE + 31 - i] = temp;
temp = *(out + OBJECT_HEADER_SIZE + i);
*(out + OBJECT_HEADER_SIZE + i) = *(out + OBJECT_HEADER_SIZE + 31 - i);
*(out + OBJECT_HEADER_SIZE + 31 - i) = temp;
}

return true;
Expand Down

0 comments on commit 2e95aa1

Please sign in to comment.