Support ChaChaPoly1305 on Android if available
In addition to making ChaCha/Poly work, this change refactors the "HasTag" implementation. 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.
Showing
想要评论请 注册 或 登录