mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
[kwm] fix: KWMv1 key generation
This commit is contained in:
@@ -11,7 +11,10 @@ const KEY: [u8; 0x20] = [
|
|||||||
impl CipherV1 {
|
impl CipherV1 {
|
||||||
pub fn new(resource_id: u32) -> Self {
|
pub fn new(resource_id: u32) -> Self {
|
||||||
let mut key = KEY;
|
let mut key = KEY;
|
||||||
for (k, r) in key.iter_mut().zip(resource_id.to_string().as_bytes()) {
|
for (k, r) in key
|
||||||
|
.iter_mut()
|
||||||
|
.zip(resource_id.to_string().as_bytes().iter().cycle())
|
||||||
|
{
|
||||||
*k ^= r;
|
*k ^= r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user