Comments (4)
Closing, as re-posted on RustCrypto/block-ciphers#71
from stream-ciphers.
That definitely looks like a bug.
It appears that when those target features are enabled, an AES-CTR implementation located directly in the aesni
crate is used, as opposed to using the implementation ctr
crate.
My guess is the CTR implementation in the aesni
crate is buggy.
As a temporary workaround, you can compose AES-CTR using the aes
and ctr
crates:
type Aes128Ctr = ctr::Ctr128<aes::Aes128>;
from stream-ciphers.
Thanks for your acknowledgment and the workaround.
Should I re-post the issue on https://github.com/RustCrypto/block-ciphers?
As a side note, the encryption is still keeping its internal state correctly, ie:
fn main() {
let key = [0u8; 32];
let counter_block = [0u8; 16];
// Prepare the cipher for further operations
let mut cipher = aes_ctr::Aes256Ctr::new_var(&key, &counter_block).unwrap();
let mut temp = [0u8; 0x1000];
cipher.encrypt(&mut temp);
println!("{:?}", &temp[..32]);
let mut temp2 = [0u8; 0x1000];
cipher.encrypt(&mut temp2);
println!("{:?}", &temp2[..32]);
println!("{}", cipher.current_pos());
}
Returns, with flags:
[220, 149, 192, 120, 162, 64, 137, 137, 173, 72, 162, 20, 146, 132, 32, 135, 83, 15, 138, 251, 199, 69, 54, 185, 169, 99, 180, 241, 196, 203, 115, 139]
[199, 233, 210, 80, 153, 134, 50, 212, 68, 53, 98, 66, 239, 4, 5, 141, 76, 175, 60, 142, 190, 185, 242, 72, 214, 114, 3, 215, 138, 67, 126, 238]
0
from stream-ciphers.
Should I re-post the issue on https://github.com/RustCrypto/block-ciphers?
Yes please, thank you!
from stream-ciphers.
Related Issues (20)
- released cfb-mode depends on [email protected] HOT 3
- Please publish aes-ctr v0.5 to crates.io HOT 2
- request for rabbit cipher HOT 1
- ctr: block size vs counter size naming HOT 3
- XChaCha20 unnecessarily limits keystream to 256gb HOT 6
- Missing algorithms HOT 4
- Remove circular dependencies on `aes` crate HOT 1
- why chacha20 seek only works up to 2^37 while xchacha20 seek works up to 2^62? HOT 1
- out of range for slice of length 16 HOT 5
- chacha20: Add wide (4-block) AVX2 impl
- Port chacha20 SIMD backends
- Locking `zeroize` to `<=1.5` for `chacha` prevents compiling with `num-bigint-dig v0.8.1` (for `rsa 0.6.0-pre`) HOT 3
- version 0.9.0 does not compile on Arduino architecture HOT 1
- chacha20: SIGSEGV in CI HOT 8
- Publish `chacha20` crate which is available `neon` feature HOT 1
- Make the neon feature available for ChaCha20 HOT 3
- Does it allow to call decryption method explicitly? HOT 1
- Add more test vectors to salsa20 ? HOT 8
- chacha20: 64-bit counter support HOT 3
- `chacha20` is missing `.zeroize()` for the SIMD backends HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stream-ciphers.