[kwm] fix: KWMv1 key generation
This commit is contained in:
parent
785b2f6f0d
commit
440df8a06b
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user