Skip to content

Commit 40ce3dc

Browse files
committed
feat: move SHARED_KEY_ENCODED, IV_SIZE, AES_KEY_SIZE to encryption_constants.rs
1 parent 01915c3 commit 40ce3dc

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

crypto/src/encryption_constants.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub(crate) const SHARED_KEY_ENCODED: &str = "3Bf8BJ3ZPSMUM2jg2ThODeLuRRD_-_iwQEaeLdcQXpg";
2+
pub(crate) const IV_SIZE: usize = 16;
3+
pub(crate) const AES_KEY_SIZE: usize = 32;

crypto/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub mod post_encryption;
1919
pub mod jwk;
2020
pub mod pbkdf2;
2121

22+
mod encryption_constants;
2223
mod payload_decode_v37;
2324
mod payload_decode_v38;
2425

crypto/src/post_encryption.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ use base64::{encode_config, STANDARD};
66
use std::collections::HashMap;
77

88
use super::aes_gcm::aes_encrypt;
9+
use crate::encryption_constants::{AES_KEY_SIZE, IV_SIZE};
910

1011
use std::str;
1112

12-
const IV_SIZE: usize = 16;
13-
const AES_KEY_SIZE: usize = 32;
14-
1513
pub enum Version {
1614
V37 = -37,
1715
V38 = -38,

0 commit comments

Comments
 (0)