From 4edd51babec6fa560c3197805d3d4ff946c2b85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 7 May 2018 10:21:56 +0200 Subject: [PATCH] Rename poly1305_setkey() to poly1305_starts() For consistency with the existing CMAC and HMAC APIs --- include/mbedtls/poly1305.h | 2 +- library/aead_chacha20_poly1305.c | 2 +- library/poly1305.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mbedtls/poly1305.h b/include/mbedtls/poly1305.h index c911b9fde..f69191578 100644 --- a/include/mbedtls/poly1305.h +++ b/include/mbedtls/poly1305.h @@ -81,7 +81,7 @@ void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx ); * or key are NULL. * Otherwise, 0 is returned to indicate success. */ -int mbedtls_poly1305_setkey( mbedtls_poly1305_context *ctx, +int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx, const unsigned char key[32] ); /** diff --git a/library/aead_chacha20_poly1305.c b/library/aead_chacha20_poly1305.c index f00380c0b..04180081a 100644 --- a/library/aead_chacha20_poly1305.c +++ b/library/aead_chacha20_poly1305.c @@ -155,7 +155,7 @@ int mbedtls_aead_chacha20_poly1305_starts( mbedtls_aead_chacha20_poly1305_contex if ( result != 0 ) goto cleanup; - result = mbedtls_poly1305_setkey( &ctx->poly1305_ctx, poly1305_key ); + result = mbedtls_poly1305_starts( &ctx->poly1305_ctx, poly1305_key ); if ( result == 0 ) { diff --git a/library/poly1305.c b/library/poly1305.c index 5a096586d..66f932c4f 100644 --- a/library/poly1305.c +++ b/library/poly1305.c @@ -256,7 +256,7 @@ void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx ) } } -int mbedtls_poly1305_setkey( mbedtls_poly1305_context *ctx, +int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx, const unsigned char key[32] ) { if ( ctx == NULL ) @@ -400,7 +400,7 @@ int mbedtls_poly1305_mac( const unsigned char key[32], mbedtls_poly1305_init( &ctx ); - result = mbedtls_poly1305_setkey( &ctx, key ); + result = mbedtls_poly1305_starts( &ctx, key ); if ( result != 0 ) goto cleanup;