Chacha20_Poly1305

Compiles semi-fine on my Gentoo system… I’ve got an extra patch for the Makefile, because it would fail otherwise: https://gist.github.com/osirisinferi/60c1a2e8bff6df464ba12fd45f6ed0c1

And I’ve moved one line in the original patch:

osiris@server openssl $ diff /tmp/original-chacha-patch-from-cloudflare.patch openssl__chacha20_poly1305_draft_and_rfc_ossl102g.patch 
4433a4434
> +    poly1305_state poly_state;
4438d4438
< +    poly1305_state poly_state;
osiris@server openssl $ 

In the original patch the line above is on line 4438, but I moved it to line number 4434 (just outside the #ifdef):

+    uint16_t       poly_buffer_used;
+    uint16_t       chacha_used;
+    poly1305_state poly_state;
+#ifdef CHAPOLY_x86_64_ASM
+    void (*poly1305_init_ptr)(poly1305_state *, const uint8_t *);

As far as I know, it doesn’t give any new bugs :stuck_out_tongue: Also, I don’t know if this fixes anything on your system or if it’s really needed… I don’t know why the #ifdef CHAPOLY_x86_64_ASM isn’t triggered on my system (it’s a 64 bits system ánd I’m compiling it with assembler code support… Perhaps some Gentoo specific fluke…)

1 Like