Merge refactoring changes #34
7 changed files with 5 additions and 8 deletions
|
|
@ -21,7 +21,6 @@ pub fn gfmul_task(args: &Value) -> Result<Vec<u8>> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serde_json::json;
|
||||
use std::str::FromStr;
|
||||
|
||||
// Note this useful idiom: importing names from outer (for mod tests) scope.
|
||||
use super::*;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ pub fn padding_oracle(args: &Value) -> Result<Vec<u8>> {
|
|||
// TODO: Collect all and send in one
|
||||
let mut payload: Vec<u8> = Vec::with_capacity(2 + 16 * 265);
|
||||
payload.extend(l_msg.to_vec());
|
||||
for j in 0..q_block_count {
|
||||
for _j in 0..q_block_count {
|
||||
// Next byte
|
||||
payload.extend(&attack_counter);
|
||||
attack_counter[i as usize] += 1;
|
||||
|
|
@ -140,7 +140,6 @@ pub fn padding_oracle(args: &Value) -> Result<Vec<u8>> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
fn test_connection() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::utils::poly::{polynomial_2_block};
|
||||
use crate::utils::poly::polynomial_2_block;
|
||||
use anyhow::{Ok, Result};
|
||||
use serde_json::Value;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ mod tests {
|
|||
}
|
||||
|
||||
println!("Result: {:?}", result);
|
||||
let bit_indices: Vec<u8> = vec![0];
|
||||
let _bit_indices: Vec<u8> = vec![0];
|
||||
assert!(false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,7 +337,6 @@ impl ByteArray {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
fn test_byte_array_shift1() {
|
||||
|
|
|
|||
|
|
@ -788,7 +788,7 @@ mod tests {
|
|||
#[test]
|
||||
fn coeff_to_binary() {
|
||||
let coefficients: Vec<u8> = vec![12, 127, 9, 0];
|
||||
let b64: &str = "ARIAAAAAAAAAAAAAAAAAgA==";
|
||||
let _b64: &str = "ARIAAAAAAAAAAAAAAAAAgA==";
|
||||
let calculated_num: u128 = coefficient_to_binary(coefficients);
|
||||
assert_eq!(
|
||||
BASE64_STANDARD.encode(calculated_num.to_ne_bytes()),
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ mod tests {
|
|||
}
|
||||
|
||||
println!("{:?}", result);
|
||||
let bit_indices: Vec<u8> = vec![0];
|
||||
let _bit_indices: Vec<u8> = vec![0];
|
||||
assert!(false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue