chachapoly: force correct mode for integrated API
Allowing DECRYPT with crypt_and_tag is a risk as people might fail to check
the tag correctly (or at all). So force them to use auth_decrypt() instead.
See also https://github.com/ARMmbed/mbedtls/pull/1668
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index 3e9ab0a..f266b82 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -491,9 +491,8 @@
mbedtls_chachapoly_setkey( &chachapoly, tmp );
TIME_AND_TSC( title,
- mbedtls_chachapoly_crypt_and_tag( &chachapoly,
- MBEDTLS_CHACHAPOLY_ENCRYPT, BUFSIZE, tmp,
- NULL, 0, buf, buf, tmp ) );
+ mbedtls_chachapoly_encrypt_and_tag( &chachapoly,
+ BUFSIZE, tmp, NULL, 0, buf, buf, tmp ) );
mbedtls_chachapoly_free( &chachapoly );
}