Skip to content

Commit

Permalink
Revert "unwrap example: reverse bytes to get extracted bytes closest …
Browse files Browse the repository at this point in the history
…to original SHA hash"

This reverts commit d5a7207.
  • Loading branch information
greg-szabo committed Apr 3, 2024
1 parent ff3308b commit 7863e06
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions yhunwrap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ static bool unwrap_data(uint8_t *key, size_t key_len, uint8_t *in, size_t in_len
// Clean up
EVP_CIPHER_CTX_free(ctx);

// Reverse first 32 bytes of the expanded secret key
if (*out_len < OBJECT_HEADER_SIZE + 32) {
return false;
}
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;
}

return true;
}

Expand Down

0 comments on commit 7863e06

Please sign in to comment.