Skip to content

Commit

Permalink
fix: Fixed aes256cbc encryption method name and added custom seeds to…
Browse files Browse the repository at this point in the history
… murmur3 hashes
  • Loading branch information
Le0X8 committed Nov 15, 2024
1 parent 379a89f commit 8554c1b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "acr"
description = "All shared code across the whole Acridotheres project"
license = "MIT"
repository = "https://github.com/acridotheres/acr"
version = "0.3.1"
version = "0.3.2"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/encryption.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod sha256cbc;
pub mod aes256cbc;
File renamed without changes.
4 changes: 2 additions & 2 deletions src/hash/murmur3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use dh::Readable;
use murmur3::murmur3_32;
use std::io::Result;

pub fn hash<'a>(file: &'a mut dyn Readable<'a>, offset: u64, size: u64) -> Result<u32> {
pub fn hash<'a>(file: &'a mut dyn Readable<'a>, offset: u64, size: u64, seed: u32) -> Result<u32> {
let pos_before = file.pos()?;

let mut limited = file.limit(offset, size)?;

let result = murmur3_32(&mut limited, 0x31082007)?;
let result = murmur3_32(&mut limited, seed)?;
let file = limited.unlimit();

file.to(pos_before)?;
Expand Down

0 comments on commit 8554c1b

Please sign in to comment.