Skip to content

chacha20: simplify implementation#76

Merged
tarcieri merged 1 commit into
masterfrom
chacha20/simplify-implementation
Jan 15, 2020
Merged

chacha20: simplify implementation#76
tarcieri merged 1 commit into
masterfrom
chacha20/simplify-implementation

Conversation

@tarcieri

Copy link
Copy Markdown
Member

The original implementation was unnecessarily complicated. This removes a bunch of needlessly complex code.

This has no measurable effect on performance.

The original implementation was unnecessarily complicated. This removes
a bunch of needlessly complex code.

This has no measurable effect on performance.
@tarcieri tarcieri changed the title chacha20: simplify software implementation chacha20: simplify implementation Jan 15, 2020
Comment thread chacha20/src/block/mod.rs
iv: [u32; IV_WORDS],
counter: u64,
) -> [u32; STATE_WORDS] {
fn rounds(&mut self, count: usize) -> [u32; STATE_WORDS] {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally this parameterizes the number of rounds enabling the implementation of ChaCha8 and ChaCha12. Again, this comes at no cost to performance (or constant-time, as the number of rounds is a constant).

@tarcieri tarcieri merged commit 32f19b4 into master Jan 15, 2020
@tarcieri tarcieri deleted the chacha20/simplify-implementation branch January 15, 2020 15:18
@tarcieri tarcieri mentioned this pull request Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant