cisco / libsrtp

Library for SRTP (Secure Realtime Transport Protocol)
Other
1.19k stars 470 forks source link

iv length is constant so set only once #649

Closed pabuhler closed 1 year ago

pabuhler commented 1 year ago

The iv length is preserved inside the EVP_CIPHER_CTX so no need to set more than once. This is especially important with OpenSSL 3 where setting the iv len is a expensive operation due to param lookup code inside of OpenSSL.

This should help performance issue with OpenSSL 3 and libsrtp with #645 in the case of GCM but does not fix all of the performance issues.

murillo128 commented 1 year ago

I have been testing this PR and it marginally helps performance, so good to have it in anyway.

pabuhler commented 1 year ago

@murillo128 I agree that it should just go in. @bifurcation could you review ?