This commit is contained in:
Dennis Schwerdel 2019-01-04 12:32:48 +01:00
parent a3f160c2a5
commit 81c18fcd83
3 changed files with 6 additions and 2 deletions

View File

@ -2,6 +2,10 @@
This project follows [semantic versioning](http://semver.org). This project follows [semantic versioning](http://semver.org).
### UNRELEASED
- [fixed] Hashed magics now also consider first character (**incompatible**)
### v0.8.2 (2018-01-02) ### v0.8.2 (2018-01-02)
- [changed] Using serde instead of rustc_serialize - [changed] Using serde instead of rustc_serialize

View File

@ -20,7 +20,7 @@ use super::util::now as util_now;
use super::poll::{Poll, Flags}; use super::poll::{Poll, Flags};
#[bench] #[bench]
fn crypto_salsa20(b: &mut Bencher) { fn crypto_chacha20(b: &mut Bencher) {
Crypto::init(); Crypto::init();
let mut crypto = Crypto::from_shared_key(CryptoMethod::ChaCha20, "test"); let mut crypto = Crypto::from_shared_key(CryptoMethod::ChaCha20, "test");
let mut payload = [0; 1500]; let mut payload = [0; 1500];

View File

@ -170,7 +170,7 @@ impl Config {
if let Some(ref name) = self.magic { if let Some(ref name) = self.magic {
if name.starts_with("hash:") { if name.starts_with("hash:") {
let mut s = SipHasher24::new(); let mut s = SipHasher24::new();
name[6..].hash(&mut s); name[5..].hash(&mut s);
let mut data = [0; 4]; let mut data = [0; 4];
Encoder::write_u32((s.finish() & 0xffff_ffff) as u32, &mut data); Encoder::write_u32((s.finish() & 0xffff_ffff) as u32, &mut data);
data data