Skip to content
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

Confusing explanation of permutation #377

Open
multun opened this issue Sep 15, 2020 · 1 comment
Open

Confusing explanation of permutation #377

multun opened this issue Sep 15, 2020 · 1 comment

Comments

@multun
Copy link
Contributor

multun commented Sep 15, 2020

The array consists of 256 bytes forming a permutation: that is, all possible index values occur exactly once as a value in the array. That means it maps every possible byte value to every possible byte value: usually different, but sometimes the same one.

I don't quite understand the last sentence, how can two bytes map to the same one with a permutation? Is it me reading it wrong, or is it something actually incorrect with this sentence?

@lvh
Copy link
Member

lvh commented Sep 15, 2020

Are you looking at the RC4 stuff? You may want to check out this PR: #375 (comment) since a paragraph that first introduces permutations is currently being edited.

Two bytes can not map to the same value. What this sentence is trying to say is that all byte values will occur in the array exactly once, so every byte will be mapped to some (exactly 1) byte. Some people assume that this must mean there are no mappings of a byte to itself (still only 1 byte!), but that's not the case: fixed points are quite common. To rephrase, for some byte values b, p(b) = b. Does that make sense?

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

No branches or pull requests

2 participants