Skip to content

Commit

Permalink
removing main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnarchistHoneybun committed Jun 27, 2024
1 parent 581b119 commit b4abbae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
7 changes: 0 additions & 7 deletions kupyna512/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod sub_units;
const STATE_SIZE: usize = 1024;
const HASH_SIZE: usize = 512;

const MAX_MESSAGE_LENGTH: usize = 18446744073709551615;

fn pad_message(message: &[u8], msg_len_bits: usize, state_size: usize) -> Vec<u8> {
let round_msg_len = message.len() * 8;
Expand Down Expand Up @@ -58,9 +57,6 @@ pub fn hash(message: Vec<u8>, length: Option<usize>) -> Result<Vec<u8>, &'static
let mut message = message;
let message_length: usize;
if let Some(len) = length {
if len > MAX_MESSAGE_LENGTH {
return Err("Message is too long");
}
if len > message.len() * 8 {
return Err("Message length is less than the provided length");
}
Expand All @@ -78,9 +74,6 @@ pub fn hash(message: Vec<u8>, length: Option<usize>) -> Result<Vec<u8>, &'static
message_length = len;

} else {
if message.len() * 8 > MAX_MESSAGE_LENGTH {
return Err("Message is too long");
}
message_length = message.len() * 8;
}

Expand Down
10 changes: 0 additions & 10 deletions kupyna512/src/main.rs

This file was deleted.

2 changes: 2 additions & 0 deletions kupyna512/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mod padding_tests;
mod blocking_tests;
mod hashing_tests;

mod full_test;

0 comments on commit b4abbae

Please sign in to comment.