Adapt the _ALT style to our new standard
- in .h files: only put the context declaration inside the #ifdef _ALT
(this was changed in 2.9.0, ie after the original PR)
- in .c file: only leave selftest out of _ALT: even though some function are
trivial to build from other parts, alt implementors might want to go another
way about them (for efficiency or other reasons)
diff --git a/library/aead_chacha20_poly1305.c b/library/aead_chacha20_poly1305.c
index 8d7b63a..2e07f1e 100644
--- a/library/aead_chacha20_poly1305.c
+++ b/library/aead_chacha20_poly1305.c
@@ -291,8 +291,6 @@
return( 0 );
}
-#endif /* MBEDTLS_AEAD_CHACHA20_POLY1305_ALT */
-
int mbedtls_aead_chacha20_poly1305_crypt_and_mac ( const unsigned char key[32],
const unsigned char nonce[12],
mbedtls_aead_chacha20_poly1305_mode_t mode,
@@ -331,6 +329,8 @@
return( result );
}
+#endif /* MBEDTLS_AEAD_CHACHA20_POLY1305_ALT */
+
#if defined(MBEDTLS_SELF_TEST)
static const unsigned char test_key[1][32] =