Browse Source

More rust tweaks

Travis Burtrum 1 year ago
parent
commit
760d14d160
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/main.rs

+ 2
- 2
src/main.rs View File

@@ -33,7 +33,7 @@ fn encrypt(data: &[u8], key: &[u8], iv: &[u8]) -> Vec<u8> {
33 33
     let mut out: Vec<u8> = vec![0; data.len()];
34 34
     let mut out_tag: Vec<u8> = vec![0; 16];;
35 35
 
36
-    encryptor.encrypt(&*data, &mut out[..],&mut out_tag[..]);
36
+    encryptor.encrypt(&*data, &mut *out,&mut *out_tag);
37 37
 
38 38
     out.extend_from_slice(&out_tag);
39 39
     return out
@@ -60,7 +60,7 @@ fn decrypt(encrypted_data: &[u8], key: &[u8], iv: &[u8]) -> Result<Vec<u8>, &'st
60 60
     let out_len = encrypted_data.len() - 16;
61 61
     let mut out: Vec<u8> = vec![0; out_len];;
62 62
 
63
-    let result = decryptor.decrypt(&encrypted_data[0..out_len], &mut out[..], &encrypted_data[out_len..]);
63
+    let result = decryptor.decrypt(&encrypted_data[0..out_len], &mut *out, &encrypted_data[out_len..]);
64 64
     if result {
65 65
         Ok(out)
66 66
     } else {

Loading…
Cancel
Save