Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion hw/arm/ipod_touch_sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ static uint64_t s5l8900_sha1_read(void *opaque, hwaddr offset, unsigned size)
//fprintf(stderr, "Hash out %08x\n", *(uint32_t *)&s->hashout[offset - 0x20]);
if(!s->hash_computed) {
// lazy compute the final hash by inspecting the last eight bytes of the buffer, which contains the length of the input data.
uint64_t data_length = swapLong(((uint64_t *)s->buffer)[s->buffer_ind / 8 - 1]) / 8;
uint64_t val = ((uint64_t *)s->buffer)[s->buffer_ind / 8 - 1];
uint64_t data_length = swapLong(&val) / 8;


SHA_CTX ctx;
SHA1_Init(&ctx);
Expand Down
Loading