mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
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
This commit is contained in:
@@ -491,9 +491,8 @@ int main( int argc, char *argv[] )
|
||||
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 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user