Skip to content

Commit

Permalink
fix(eea3_128): change the use of ZUC128 to Zuc128
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyliu16 committed Dec 15, 2024
1 parent 57ebd4e commit 62738fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/eea3_128.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! ZUC Confidentiality Algorithm
//! ([GB/T 33133.2-2021](https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=5D3CBA3ADEC7989344BD1E63006EF2B3 ))
use crate::ZUC128;
use super::Zuc128;

/// zuc xor encryption algorithm
/// ([GB/T 33133.2-2021](https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=5D3CBA3ADEC7989344BD1E63006EF2B3 ))
Expand All @@ -18,12 +18,10 @@ use crate::ZUC128;
#[allow(clippy::needless_range_loop)]
#[allow(clippy::cast_possible_truncation)]
pub fn encryption_xor(ck: u128, iv: u128, length: u32, ibs: &[u8]) -> Vec<u8> {
let l = (length + 31) / 32;

let ck = ck.to_be_bytes();
let iv = iv.to_ne_bytes();

let mut zuc = ZUC128::new(&ck, &iv);
let mut zuc = Zuc128::new(&ck, &iv);
let mut res = ibs.to_vec();
let mut keys = zuc.generate().to_be();

Expand Down

0 comments on commit 62738fc

Please sign in to comment.