mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
chore: improve qmc v1 impl
This commit is contained in:
@@ -5,8 +5,7 @@ pub const V1_KEY_SIZE: usize = 128;
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub fn qmc1_transform(key: &[u8; V1_KEY_SIZE], value: u8, offset: usize) -> u8 {
|
pub fn qmc1_transform(key: &[u8; V1_KEY_SIZE], value: u8, offset: usize) -> u8 {
|
||||||
let offset = match offset {
|
let offset = match offset {
|
||||||
0..V1_OFFSET_BOUNDARY => offset,
|
0..=V1_OFFSET_BOUNDARY => offset,
|
||||||
V1_OFFSET_BOUNDARY => V1_OFFSET_BOUNDARY,
|
|
||||||
offset => offset % V1_OFFSET_BOUNDARY,
|
offset => offset % V1_OFFSET_BOUNDARY,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user