chachapoly: adjust parameter order
This module used (len, pointer) while (pointer, len) is more common in the
rest of the library, in particular it's what's used in the GCM API that
very comparable to it, so switch to (pointer, len) for consistency.
Note that the crypt_and_tag() and auth_decrypt() functions were already using
the same convention as GCM, so this also increases intra-module consistency.
diff --git a/library/chachapoly.c b/library/chachapoly.c
index d599c52..9ca21b3 100644
--- a/library/chachapoly.c
+++ b/library/chachapoly.c
@@ -175,8 +175,8 @@
}
int mbedtls_chachapoly_update_aad( mbedtls_chachapoly_context *ctx,
- size_t aad_len,
- const unsigned char *aad )
+ const unsigned char *aad,
+ size_t aad_len )
{
if ( ctx == NULL )
{
@@ -311,7 +311,7 @@
if ( result != 0 )
goto cleanup;
- result = mbedtls_chachapoly_update_aad( ctx, aad_len, aad );
+ result = mbedtls_chachapoly_update_aad( ctx, aad, aad_len );
if ( result != 0 )
goto cleanup;