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

Add AES-GCM Support #85

Closed
Sean-Der opened this issue Jul 14, 2020 · 4 comments · Fixed by #88
Closed

Add AES-GCM Support #85

Sean-Der opened this issue Jul 14, 2020 · 4 comments · Fixed by #88

Comments

@Sean-Der
Copy link
Member

I am working on a benchmark to show RTSP -> WebRTC fanout performance. I want to land this first before getting numbers :)

This is the difference when using libsrtp, so we should see a pretty big improvement for Pion as well! This is due to be able to use hardware acceleration (Auth+Encrypt) can all be done in one step now.

-- aes_cm_128_hmac_sha1_32
./a.out  1.83s user 0.01s system 99% cpu 1.843 total
./a.out  1.84s user 0.01s system 99% cpu 1.856 total
./a.out  1.83s user 0.00s system 99% cpu 1.837 total
./a.out  1.82s user 0.01s system 99% cpu 1.831 total
./a.out  2.04s user 0.01s system 99% cpu 2.065 total
./a.out  1.82s user 0.01s system 99% cpu 1.834 total
./a.out  1.84s user 0.01s system 99% cpu 1.857 total
./a.out  1.83s user 0.00s system 99% cpu 1.843 total
./a.out  1.85s user 0.01s system 99% cpu 1.860 total
./a.out  1.83s user 0.01s system 99% cpu 1.839 total

-- aes_gcm_128_16
./a.out  0.76s user 0.00s system 99% cpu 0.772 total
./a.out  0.81s user 0.00s system 99% cpu 0.814 total
./a.out  0.75s user 0.00s system 99% cpu 0.762 total
./a.out  0.75s user 0.01s system 99% cpu 0.760 total
./a.out  0.76s user 0.00s system 99% cpu 0.765 total
./a.out  0.76s user 0.00s system 99% cpu 0.765 total
./a.out  0.79s user 0.01s system 99% cpu 0.803 total
./a.out  0.77s user 0.01s system 99% cpu 0.780 total
./a.out  0.75s user 0.00s system 99% cpu 0.762 total
./a.out  0.79s user 0.01s system 99% cpu 0.796 total
@Sean-Der
Copy link
Member Author

https://tools.ietf.org/html/rfc7714 is the RFC for this

Sean-Der added a commit that referenced this issue Jul 15, 2020
key+salt len should be determined by profile

Relates to #85
Sean-Der added a commit that referenced this issue Jul 15, 2020
key+salt len should be determined by profile

Relates to #85
Sean-Der added a commit that referenced this issue Jul 15, 2020
key+salt len should be determined by profile

Relates to #85
Sean-Der added a commit that referenced this issue Jul 15, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
Sean-Der added a commit to pion/dtls that referenced this issue Jul 15, 2020
Sean-Der added a commit to pion/dtls that referenced this issue Jul 15, 2020
Sean-Der added a commit to pion/dtls that referenced this issue Jul 15, 2020
@at-wat
Copy link
Member

at-wat commented Jul 16, 2020

Sean-Der added a commit to pion/dtls that referenced this issue Jul 16, 2020
@Sean-Der
Copy link
Member Author

@at-wat that is super cool I had no idea FireFox made these stats available!

Sean-Der added a commit that referenced this issue Jul 16, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
Sean-Der added a commit that referenced this issue Jul 16, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
Sean-Der added a commit that referenced this issue Jul 16, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
Sean-Der added a commit that referenced this issue Jul 17, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
Sean-Der added a commit that referenced this issue Jul 18, 2020
This removes a lot of profile specific constants and insteads
put them behind the profile. Key, Salt and TagLen need to be
determined by the profile.

Relates to #85
@Sean-Der
Copy link
Member Author

Sean-Der commented Jul 18, 2020

I have RTP done in my local tree! @jech I think you will be really interested in this since you are chasing performance :)

ProtectionProfileAes128CmHmacSha1_80 -  BenchmarkEncryptRTP-4             636799              1706 ns/op
ProtectionProfileAeadAes128Gcm       -  BenchmarkEncryptRTP-4           2941428               403 ns/op 

Sean-Der added a commit that referenced this issue Jul 19, 2020
Sean-Der added a commit that referenced this issue Jul 19, 2020
Sean-Der added a commit that referenced this issue Jul 19, 2020
Sean-Der added a commit that referenced this issue Jul 19, 2020
Sean-Der added a commit that referenced this issue Jul 20, 2020
Sean-Der added a commit that referenced this issue Jul 20, 2020
Sean-Der added a commit that referenced this issue Jul 20, 2020
Sean-Der added a commit that referenced this issue Jul 21, 2020
Sean-Der added a commit that referenced this issue Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants