From 4023078e1415ea5d5a2de45d7666f0cc529f4b1d Mon Sep 17 00:00:00 2001 From: ccli8 Date: Thu, 21 Dec 2017 16:10:18 +0800 Subject: [PATCH] [NUC472/M487] Remove unnecessary H/W context clone functions in SHA alter. --- .../TARGET_M480/sha/sha_alt_hw.c | 18 ------------------ .../TARGET_M480/sha/sha_alt_hw.h | 6 ------ .../TARGET_NUC472/sha/sha_alt_hw.c | 12 ------------ .../TARGET_NUC472/sha/sha_alt_hw.h | 4 ---- 4 files changed, 40 deletions(-) diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.c b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.c index 54d63741c1..1067fb4057 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.c +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.c @@ -59,12 +59,6 @@ void mbedtls_sha1_hw_free(crypto_sha_context *ctx) crypto_zeroize(ctx, sizeof(*ctx)); } -void mbedtls_sha1_hw_clone(crypto_sha_context *dst, - const crypto_sha_context *src) -{ - *dst = *src; -} - void mbedtls_sha1_hw_starts(crypto_sha_context *ctx) { // NOTE: mbedtls may call mbedtls_shaXXX_starts multiple times and then call the ending mbedtls_shaXXX_finish. Guard from it. @@ -138,12 +132,6 @@ void mbedtls_sha256_hw_free(crypto_sha_context *ctx) crypto_zeroize(ctx, sizeof(*ctx)); } -void mbedtls_sha256_hw_clone(crypto_sha_context *dst, - const crypto_sha_context *src) -{ - *dst = *src; -} - void mbedtls_sha256_hw_starts( crypto_sha_context *ctx, int is224) { // NOTE: mbedtls may call mbedtls_shaXXX_starts multiple times and then call the ending mbedtls_shaXXX_finish. Guard from it. @@ -219,12 +207,6 @@ void mbedtls_sha512_hw_free(crypto_sha_context *ctx) crypto_zeroize(ctx, sizeof(*ctx)); } -void mbedtls_sha512_hw_clone(crypto_sha_context *dst, - const crypto_sha_context *src) -{ - *dst = *src; -} - void mbedtls_sha512_hw_starts( crypto_sha_context *ctx, int is384) { // NOTE: mbedtls may call mbedtls_shaXXX_starts multiple times and then call the ending mbedtls_shaXXX_finish. Guard from it. diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h index a492609be3..120a8abdf7 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/sha/sha_alt_hw.h @@ -47,8 +47,6 @@ void crypto_sha_getinternstate(unsigned char output[], size_t olen); void mbedtls_sha1_hw_init( crypto_sha_context *ctx ); void mbedtls_sha1_hw_free( crypto_sha_context *ctx ); -void mbedtls_sha1_hw_clone( crypto_sha_context *dst, - const crypto_sha_context *src ); void mbedtls_sha1_hw_starts( crypto_sha_context *ctx ); void mbedtls_sha1_hw_update( crypto_sha_context *ctx, const unsigned char *input, size_t ilen ); void mbedtls_sha1_hw_finish( crypto_sha_context *ctx, unsigned char output[20] ); @@ -60,8 +58,6 @@ void mbedtls_sha1_hw_process( crypto_sha_context *ctx, const unsigned char data[ void mbedtls_sha256_hw_init( crypto_sha_context *ctx ); void mbedtls_sha256_hw_free( crypto_sha_context *ctx ); -void mbedtls_sha256_hw_clone( crypto_sha_context *dst, - const crypto_sha_context *src ); void mbedtls_sha256_hw_starts( crypto_sha_context *ctx, int is224 ); void mbedtls_sha256_hw_update( crypto_sha_context *ctx, const unsigned char *input, size_t ilen ); @@ -74,8 +70,6 @@ void mbedtls_sha256_hw_process( crypto_sha_context *ctx, const unsigned char dat void mbedtls_sha512_hw_init( crypto_sha_context *ctx ); void mbedtls_sha512_hw_free( crypto_sha_context *ctx ); -void mbedtls_sha512_hw_clone( crypto_sha_context *dst, - const crypto_sha_context *src ); void mbedtls_sha512_hw_starts( crypto_sha_context *ctx, int is384 ); void mbedtls_sha512_hw_update( crypto_sha_context *ctx, const unsigned char *input, size_t ilen ); diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.c b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.c index c6dc7394ac..246a75858b 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.c +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.c @@ -59,12 +59,6 @@ void mbedtls_sha1_hw_free(crypto_sha_context *ctx) crypto_zeroize(ctx, sizeof(*ctx)); } -void mbedtls_sha1_hw_clone(crypto_sha_context *dst, - const crypto_sha_context *src) -{ - *dst = *src; -} - void mbedtls_sha1_hw_starts(crypto_sha_context *ctx) { // NOTE: mbedtls may call mbedtls_shaXXX_starts multiple times and then call the ending mbedtls_shaXXX_finish. Guard from it. @@ -138,12 +132,6 @@ void mbedtls_sha256_hw_free(crypto_sha_context *ctx) crypto_zeroize(ctx, sizeof(*ctx)); } -void mbedtls_sha256_hw_clone(crypto_sha_context *dst, - const crypto_sha_context *src) -{ - *dst = *src; -} - void mbedtls_sha256_hw_starts( crypto_sha_context *ctx, int is224) { // NOTE: mbedtls may call mbedtls_shaXXX_starts multiple times and then call the ending mbedtls_shaXXX_finish. Guard from it. diff --git a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h index 18caf697e0..9b91f7c27a 100644 --- a/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h +++ b/features/mbedtls/targets/TARGET_NUVOTON/TARGET_NUC472/sha/sha_alt_hw.h @@ -47,8 +47,6 @@ void crypto_sha_getinternstate(unsigned char output[], size_t olen); void mbedtls_sha1_hw_init( crypto_sha_context *ctx ); void mbedtls_sha1_hw_free( crypto_sha_context *ctx ); -void mbedtls_sha1_hw_clone( crypto_sha_context *dst, - const crypto_sha_context *src ); void mbedtls_sha1_hw_starts( crypto_sha_context *ctx ); void mbedtls_sha1_hw_update( crypto_sha_context *ctx, const unsigned char *input, size_t ilen ); void mbedtls_sha1_hw_finish( crypto_sha_context *ctx, unsigned char output[20] ); @@ -60,8 +58,6 @@ void mbedtls_sha1_hw_process( crypto_sha_context *ctx, const unsigned char data[ void mbedtls_sha256_hw_init( crypto_sha_context *ctx ); void mbedtls_sha256_hw_free( crypto_sha_context *ctx ); -void mbedtls_sha256_hw_clone( crypto_sha_context *dst, - const crypto_sha_context *src ); void mbedtls_sha256_hw_starts( crypto_sha_context *ctx, int is224 ); void mbedtls_sha256_hw_update( crypto_sha_context *ctx, const unsigned char *input, size_t ilen );