Hello cryptographistas!
Currently aioquic's QUIC header protection and encryption features use C code linked against OpenSSL. I am considering porting this to pure Python using only cryptography. On the whole things work, and a work in progress is here:
aiortc/aioquic#457
One thing I noticed is that the ChaCha20 class takes the nonce in its constructor. Unfortunately QUIC uses a nonce which is derived from each packet's header. This means that when using the CHACHA20_POLY1305_SHA256 cipher suite, for every packet we need to tear down / recreate the ChaCha20 instance which is not cheap.
Would you consider an API which allows updating the nonce? This can be implemented by calling:
EVP_CipherInit_ex(ctx, NULL, NULL, NULL, nonce, operation)
Hello cryptographistas!
Currently
aioquic's QUIC header protection and encryption features use C code linked against OpenSSL. I am considering porting this to pure Python using onlycryptography. On the whole things work, and a work in progress is here:aiortc/aioquic#457
One thing I noticed is that the
ChaCha20class takes the nonce in its constructor. Unfortunately QUIC uses a nonce which is derived from each packet's header. This means that when using theCHACHA20_POLY1305_SHA256cipher suite, for every packet we need to tear down / recreate theChaCha20instance which is not cheap.Would you consider an API which allows updating the nonce? This can be implemented by calling:
EVP_CipherInit_ex(ctx, NULL, NULL, NULL, nonce, operation)