chore: improve qmc v1 impl

This commit is contained in:
鲁树人 2024-09-04 19:12:50 +01:00
parent 4cb2532c25
commit aa4c650ff0

View File

@ -5,8 +5,7 @@ pub const V1_KEY_SIZE: usize = 128;
#[inline]
pub fn qmc1_transform(key: &[u8; V1_KEY_SIZE], value: u8, offset: usize) -> u8 {
let offset = match offset {
0..V1_OFFSET_BOUNDARY => offset,
V1_OFFSET_BOUNDARY => V1_OFFSET_BOUNDARY,
0..=V1_OFFSET_BOUNDARY => offset,
offset => offset % V1_OFFSET_BOUNDARY,
};