Browse Source

rust-protocol: Fix checksum.

Mathias Gottschlag 5 years ago
parent
commit
9aefb20f2c
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      common/rust-protocol/src/lib.rs

+ 1
- 1
common/rust-protocol/src/lib.rs View File

35
         if !self.encode(&mut data[8..30]) {
35
         if !self.encode(&mut data[8..30]) {
36
             return false;
36
             return false;
37
         }
37
         }
38
-        let checksum = State::<KERMIT>::calculate(&data[0..30]);
38
+        let checksum = State::<KERMIT>::calculate(&data[8..30]);
39
         data[30..].copy_from_slice(&checksum.to_le_bytes());
39
         data[30..].copy_from_slice(&checksum.to_le_bytes());
40
         encrypt_cbc(key, data);
40
         encrypt_cbc(key, data);
41
         true
41
         true

Loading…
Cancel
Save