Skip to content

Make poly1305 faster #6116

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

Merged
merged 3 commits into from
Aug 21, 2020
Merged

Make poly1305 faster #6116

merged 3 commits into from
Aug 21, 2020

Conversation

jedisct1
Copy link
Contributor

@jedisct1 jedisct1 commented Aug 21, 2020

This makes our poly1305 implementation slightly faster

crypto/benchmark (release-fast):

  • Before: poly1305: 1851 MiB/s
  • After: poly1305: 2119 MiB/s

@andrewrk
Copy link
Member

Btw @jedisct1 are you aware of Zig's SIMD language features?

@jedisct1
Copy link
Contributor Author

Btw @jedisct1 are you aware of Zig's SIMD language features?

Hi Andrew,

I'm aware that @Vector exists, but I haven't used it yet. But I really want to :)

Are shuffle instructions available? How about AESNI/CLMUL? Is there a way to access intrinsics without using inline assembly?

@ifreund
Copy link
Member

ifreund commented Aug 21, 2020

Are shuffle instructions available? How about AESNI/CLMUL? Is there a way to access intrinsics without using inline assembly?

We've got @shuffle for shuffle instructions. Don't think there's any support for AESNI/CLMUL aside from inline assembly yet. Perhaps this example Protty made a while back would help clarify how SIMD vectors work in zig: https://zig.godbolt.org/z/oSpjR8. You may also want to check out #903

@andrewrk
Copy link
Member

Are shuffle instructions available?

shuffle

How about AESNI/CLMUL?

This is the first I've heard of those, I will have to look into this and get back to you.

Is there a way to access intrinsics without using inline assembly?

Yes. Zig's SIMD is a higher level abstraction than inline assembly intrinsics.

@andrewrk andrewrk merged commit dad7af0 into ziglang:master Aug 21, 2020
@jedisct1 jedisct1 deleted the polyfast branch August 21, 2020 20:56
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.

3 participants