mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-26 17:03:43 +02:00
Build fixes.
This commit is contained in:
parent
700855424c
commit
1a3d9a28a0
1 changed files with 4 additions and 4 deletions
|
@ -69,7 +69,7 @@ impl<const HS: usize, const B: usize> IBLT<HS, B> {
|
||||||
r.read_exact(&mut b.key_sum)?;
|
r.read_exact(&mut b.key_sum)?;
|
||||||
r.read_exact(&mut tmp)?;
|
r.read_exact(&mut tmp)?;
|
||||||
b.check_hash_sum = u64::from_le_bytes(tmp);
|
b.check_hash_sum = u64::from_le_bytes(tmp);
|
||||||
let c = varint::read(r)?.0 + prev_c;
|
let c = ((varint::read(r)?.0 as i64) + prev_c) as u64;
|
||||||
if (c & 1) == 0 {
|
if (c & 1) == 0 {
|
||||||
b.count = c.wrapping_shr(1) as i64;
|
b.count = c.wrapping_shr(1) as i64;
|
||||||
} else {
|
} else {
|
||||||
|
@ -101,7 +101,7 @@ impl<const HS: usize, const B: usize> IBLT<HS, B> {
|
||||||
assert!(HS >= 8);
|
assert!(HS >= 8);
|
||||||
assert!(key.len() >= HS);
|
assert!(key.len() >= HS);
|
||||||
let iteration_indices: [u64; 8] = unsafe { transmute(zerotier_core_crypto::hash::SHA512::hash(key)) };
|
let iteration_indices: [u64; 8] = unsafe { transmute(zerotier_core_crypto::hash::SHA512::hash(key)) };
|
||||||
let check_hash = Self::calc_check_hash::<HS>(&key);
|
let check_hash = calc_check_hash::<HS>(&key);
|
||||||
for i in 0..KEY_MAPPING_ITERATIONS {
|
for i in 0..KEY_MAPPING_ITERATIONS {
|
||||||
let b = &mut self.map[(u64::from_le(iteration_indices[i]) as usize) % B];
|
let b = &mut self.map[(u64::from_le(iteration_indices[i]) as usize) % B];
|
||||||
for x in 0..HS {
|
for x in 0..HS {
|
||||||
|
@ -149,7 +149,7 @@ impl<const HS: usize, const B: usize> IBLT<HS, B> {
|
||||||
if b.is_singular() {
|
if b.is_singular() {
|
||||||
let key = b.key_sum.clone();
|
let key = b.key_sum.clone();
|
||||||
let iteration_indices: [u64; 8] = unsafe { transmute(zerotier_core_crypto::hash::SHA512::hash(&key)) };
|
let iteration_indices: [u64; 8] = unsafe { transmute(zerotier_core_crypto::hash::SHA512::hash(&key)) };
|
||||||
let check_hash = Self::calc_check_hash::<HS>(&key);
|
let check_hash = calc_check_hash::<HS>(&key);
|
||||||
|
|
||||||
f(&key);
|
f(&key);
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ mod tests {
|
||||||
|
|
||||||
use zerotier_core_crypto::hash::SHA384;
|
use zerotier_core_crypto::hash::SHA384;
|
||||||
|
|
||||||
use crate::iblt::*;
|
use crate::util::iblt::*;
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Reference in a new issue