-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Support ChaChaPoly1305 on Android if available #52814
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
Conversation
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsThis implements ChaChaPoly1305 on Android, if it is available.
|
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.c
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs
Outdated
Show resolved
Hide resolved
The CIPHER_HAS_TAG was used to determine if the GCMParameterSpec configuration is needed for variable length tags. While ChaCha20Poly1305 has authentication tags, it does not permit a tag length other than 16 bytes, so there is nothing to configure. This renames the CIPHER_HAS_TAG to be more specific that the cipher supports more than one tag length, and removes it from ChaCha20Poly1305. This simplifies the IV initialization a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an Android interop expert, but the control flow LGTM.
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.c
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs
Show resolved
Hide resolved
Browser / wasm failure is most likely unrelated. |
...ecurity.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Android.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me (modulo one nod and smile). I'm happy so long as @jkoritzinsky is happy with the JNI code.
This implements ChaChaPoly1305 on Android, if it is available.
Contributes to #52482.
/cc @jkoritzinsky @steveisok