File: update-aes.patch

package info (click to toggle)
rust-rusty-paseto 0.7.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,580 kB
  • sloc: makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Update to aes 0.8
Forwarded: https://github.com/rrrodzilla/rusty_paseto/pull/44
Last-Update: 2024-07-13
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/core/common/cipher_text_impl/v1_local.rs
+++ b/src/core/common/cipher_text_impl/v1_local.rs
@@ -2,5 +2,4 @@
 use std::marker::PhantomData;
-use aes::Aes256Ctr;
+use aes::cipher::{KeyIvInit, StreamCipher};
 use aes::cipher::generic_array::GenericArray;
-use aes::cipher::{NewCipher, StreamCipher};
 use crate::core::common::cipher_text::CipherText;
@@ -9,2 +8,4 @@
 
+type Aes256Ctr = ctr::Ctr64BE<aes::Aes256>;
+
 impl CipherText<V1, Local> {
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -44,4 +44,7 @@
 [dependencies.aes]
-version = "0.7.5"
-features = ["ctr"]
+version = "0.8"
+optional = true
+
+[dependencies.ctr]
+version = "0.9"
 optional = true
@@ -178,3 +181,3 @@
     "core",
-    "aes",
+    "aes", "ctr",
     "chacha20",
@@ -210,3 +213,3 @@
     "core",
-    "aes",
+    "aes", "ctr",
     "hmac",
--- a/src/core/common/cipher_text_impl/v3_local.rs
+++ b/src/core/common/cipher_text_impl/v3_local.rs
@@ -2,7 +2,8 @@
 use std::marker::PhantomData;
-use aes::Aes256Ctr;
+use aes::cipher::{KeyIvInit, StreamCipher};
 use aes::cipher::generic_array::GenericArray;
-use aes::cipher::{NewCipher, StreamCipher};
 use crate::core::common::{CipherText, EncryptionKey};
 use crate::core::{Local, V3};
+
+type Aes256Ctr = ctr::Ctr64BE<aes::Aes256>;