tomaswolf commented on PR #530:
URL: https://github.com/apache/mina-sshd/pull/530#issuecomment-2243556103

   > I don't think the Java built-in ChaCha20-Poly1305 can be used for SSH.
   
   Indeed it cannot, but mainly because the Poly1305 setup is done differently. 
The IETF version from [RFC 8439](https://datatracker.ietf.org/doc/html/rfc8439) 
is just not the same as the SSH version of ChaCha20-Poly1305. But on Java 11 or 
newer, one can use the simple "ChaCha20" cipher from the standard SunJCE 
provider as a replacement for our ChaChaEngine, and do the special Poly1305 
setup as we do now. The 96-32bit vs. 64-64bit difference can be dealt with. 
Unfortunately SunJCE does not provide a plain Poly1305 mac (see 
[JDK-8253394](https://bugs.openjdk.org/browse/JDK-8253394)), so that one would 
still be hand-written code.
   
   Such a ChaCha20-Poly1305 based on 
`javax.crypto.Cipher.getInstance("ChaCha20", "SunJCE");` and our Poly1305Mac is 
again faster than any games we can play with `IntBuffer`, so if one wants to 
have different implementations per Java version, I'd take this approach.
   
   For Java 8, I have not found anything better than the version from commit 
e152cc3.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to