-
Notifications
You must be signed in to change notification settings - Fork 880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove rustc-serialize (#359) #386
Changes from 1 commit
66193eb
c4a4a86
8537e96
bc9dd63
25f91c0
f8da503
cfb9990
d6b1a3e
7c8f52e
6fb5fd1
2d0f8d6
edf1d69
eb2a9d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,19 +19,19 @@ pub(crate) fn ctr(key_size: KeySize, key: &[u8], iv: &[u8]) -> Box<StreamCipherC | |
#[cfg(all(feature = "aes-all", any(target_arch = "x86_64", target_arch = "x86")))] | ||
pub(crate) fn ctr(key_size: KeySize, key: &[u8], iv: &[u8]) -> Box<StreamCipherCore + 'static> { | ||
if *aes_alt::AES_NI { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't really digged into the crate, but from what I understand the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aes_ctr run compile time switch between NI and soft implementation (to activate NI only crate flags from original PR msg should be use). A runtime check is not in aes_ctr crate, that is what eas-all feature does, but honestly I doubt that there is a lot of x86 cpu that could not run NI (I did my tests with qemu). |
||
ctr_int(key_size, key, iv) | ||
} else { | ||
aes_alt::ctr_alt(key_size, key, iv) | ||
} else { | ||
ctr_int(key_size, key, iv) | ||
} | ||
} | ||
|
||
|
||
#[cfg(all(feature = "aes-all", any(target_arch = "x86_64", target_arch = "x86")))] | ||
mod aes_alt { | ||
extern crate ctr; | ||
extern crate aes_soft; | ||
extern crate aesni; | ||
use self::ctr::Ctr128; | ||
use self::aes_soft::{Aes128, Aes256}; | ||
use self::aesni::{Aes128, Aes256}; | ||
use self::ctr::stream_cipher::{NewFixStreamCipher, StreamCipherCore}; | ||
use self::ctr::stream_cipher::generic_array::GenericArray; | ||
use super::KeySize; | ||
|
@@ -99,10 +99,11 @@ fn assert_non_native_run() { | |
#[cfg(all( | ||
feature = "aes-all", | ||
any(target_arch = "x86_64", target_arch = "x86"), | ||
not(all(target_feature = "aes", target_feature = "ssse3")), | ||
any(target_feature = "aes", target_feature = "ssse3"), | ||
))] | ||
compile_error!( | ||
"enable aes and ssse3 target features if using aes-all to build, e.g. with \ | ||
"aes-all must be compile without aes and sse3 flags : currently \ | ||
is_x86_feature_detected macro will not detect feature correctly otherwhise. \ | ||
RUSTFLAGS=\"-C target-feature=+aes,+ssse3\" enviromental variable. \ | ||
For x86 target arch additionally enable sse2 target feature." | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheme is there anything in the git-repo that isn't in the release on crates.io? Or why can't we use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes there was a little change, but RustCrypto guys merge it: RustCrypto/block-ciphers#22 , so we can now use the crates.io dependancy (I change it).