-
Notifications
You must be signed in to change notification settings - Fork 62
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
0.6 candidate patterns #81
Comments
I'm not sure I understand the score part. If the goal is for there to be "no simple way for a pattern of differences to cancel out", why would scoring more cancellations be better? (I'm just asking about the wording here, not the code). As for larger block sizes, the main issue there is usually what to do about residuals. - Casey |
It is internal cancellations needed to cancel the entire change, so basically what it says it that something unlikely has to happen 11 times for a full internal collision to occur. There is going to be some waste with larger blocks, that is unavoidable, but there is definitely also an advantage for larger blocks that will more than offset this when the input gets large enough. |
I found a cool trick while playing around with a new function, with 3-reg instructions you can switch what registers get used for what lanes during computation, without using any additional instructions, so for instance this naive implementation of 4 rounds with lane shifts can be rewritten unrolled swapping the registers around as it goes:
This way we can operate on 128 byte blocks instead of 256 byte. This could also be used for making functions with a non-power-of-2 state that still operate on power-of-2 blocks. |
That does seem good - I have never profiled register renaming in the front end, btw, but it's not an ALU op, so there's also the fact that at least some number of registers can be renamed every cycle "for free" anyway... meaning that even without ternary ops, you can still do this, because a = op b c is basically the same cost as b = op b c because register renaming is a front-end op only. - Casey |
I have searched for a new pattern for input digestion, the the goal for the input pattern is that there should be no simple way for a pattern of differences to cancel out. I have a tool that tries to estimate how simple the simplest pattern is, it delivers results in number of lanes where 4 bytes cancel out.
The following pattern scores 5 cancellations. Each round digests 32 bytes of input, denoted as IN0 and IN1:
Another slightly more expensive pattern scores 11 cancellations:
Both patterns are designed so that an ARM version can use the pre-aes xor to replace an xor input instruction, and then add in an xor after the aes.
The first pattern could be used for a level 1 function similar to 0.5, the second, while as best i can tell not quite reaching 128 bits of adversarial resistance, might still be practically good enough for hardening hash tables.
To get higher hash levels I'm also tinkering with looping over the input in large blocks (~1KiB).
The text was updated successfully, but these errors were encountered: