Skip to content

Commit bcbda3e

Browse files
Ron EldorRon Eldor
authored andcommitted
Return not supported for internal process function
Return the `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for the internal process function, as it is not public.
1 parent 7822fa8 commit bcbda3e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

features/cryptocell/FEATURE_CRYPTOCELL310/sha1_alt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "mbedtls/sha1.h"
2222
#if defined(MBEDTLS_SHA1_ALT)
2323
#include <string.h>
24+
#include "mbedtls/platform.h"
2425

2526
void mbedtls_sha1_init( mbedtls_sha1_context *ctx )
2627
{
@@ -78,8 +79,6 @@ int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx,
7879
int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
7980
const unsigned char data[64] )
8081
{
81-
if( CRYS_HASH_Update( &ctx->crys_hash_ctx, (uint8_t*)data, 64 ) != CRYS_OK )
82-
return ( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
83-
return ( 0 );
82+
return( MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED );
8483
}
8584
#endif //MBEDTLS_SHA1_ALT

features/cryptocell/FEATURE_CRYPTOCELL310/sha256_alt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "mbedtls/sha256.h"
2222
#if defined(MBEDTLS_SHA256_ALT)
2323
#include <string.h>
24+
#include "mbedtls/platform.h"
2425

2526
void mbedtls_sha256_init( mbedtls_sha256_context *ctx )
2627
{
@@ -53,9 +54,7 @@ int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 )
5354
int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
5455
const unsigned char data[64] )
5556
{
56-
if( CRYS_HASH_Update( &ctx->crys_hash_ctx, (uint8_t*)data, 64 ) != CRYS_OK )
57-
return ( MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED );
58-
return ( 0 );
57+
return( MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED );
5958
}
6059

6160
int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,

0 commit comments

Comments
 (0)