mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01: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:
parent
26c3b0a4b1
commit
3dc62a0a9b
5 changed files with 53 additions and 54 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue