-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CryptoPals: Rust: convert project from cli to library
- Loading branch information
1 parent
82e5a02
commit 2c9a25f
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![feature(exact_chunks)] | ||
|
||
pub mod base64; | ||
pub mod hex; | ||
pub mod utils; | ||
|
||
#[cfg(test)] | ||
mod set1 { | ||
use super::*; | ||
|
||
#[test] | ||
fn problem1() { | ||
let input = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"; | ||
let bytes = hex::string_to_bytes(input).expect("Failed to parse hex input"); | ||
assert_eq!( | ||
base64::encode(&bytes), | ||
"SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t" | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.