Skip to content

Commit

Permalink
Fix misalignement error
Browse files Browse the repository at this point in the history
  • Loading branch information
ogxd committed Oct 29, 2023
1 parent 29d191a commit ac6e081
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gxhash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn gxhash(input: &[u8], seed: i32) -> state {
let hash_vector = if len <= VECTOR_SIZE {
gxhash_process_last(ptr, create_empty(), len)
} else if len <= VECTOR_SIZE * 2 {
gxhash_process_last(ptr.offset(1), compress(*ptr, create_empty()), len - VECTOR_SIZE)
gxhash_process_last(ptr.offset(1), compress(load_unaligned(ptr), create_empty()), len - VECTOR_SIZE)
} else if len < VECTOR_SIZE * 8 {
gxhash_process_1(ptr, create_empty(), len)
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/gxhash/platform/arm_128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,6 @@ pub unsafe fn finalize(hash: state, seed: i32) -> state {
hash = aes_encrypt(hash, ReinterpretUnion{ uint32: keys_1 }.uint8);
hash = aes_encrypt(hash, ReinterpretUnion{ uint32: keys_2 }.uint8);
hash = aes_encrypt_last(hash, ReinterpretUnion{ uint32: keys_3 }.uint8);
return ReinterpretUnion{ uint8: hash }.int8;

ReinterpretUnion{ uint8: hash }.int8
}

0 comments on commit ac6e081

Please sign in to comment.