@@ -13,13 +13,10 @@ void common_hal_hashlib_hash_update(hashlib_hash_obj_t *self, const uint8_t *dat
1313 if (self -> hash_type == MBEDTLS_SSL_HASH_SHA1 ) {
1414 mbedtls_sha1_update_ret (& self -> sha1 , data , datalen );
1515 return ;
16- }
17- #if CIRCUITPY_HASHLIB_SHA256
18- else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
16+ } else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
1917 mbedtls_sha256_update_ret (& self -> sha256 , data , datalen );
2018 return ;
2119 }
22- #endif
2320}
2421
2522void common_hal_hashlib_hash_digest (hashlib_hash_obj_t * self , uint8_t * data , size_t datalen ) {
@@ -33,26 +30,19 @@ void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, siz
3330 mbedtls_sha1_clone (& copy , & self -> sha1 );
3431 mbedtls_sha1_finish_ret (& self -> sha1 , data );
3532 mbedtls_sha1_clone (& self -> sha1 , & copy );
36- }
37- #if CIRCUITPY_HASHLIB_SHA256
38- else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
33+ } else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
3934 mbedtls_sha256_context copy ;
4035 mbedtls_sha256_clone (& copy , & self -> sha256 );
4136 mbedtls_sha256_finish_ret (& self -> sha256 , data );
4237 mbedtls_sha256_clone (& self -> sha256 , & copy );
4338 }
44- #endif
4539}
4640
4741size_t common_hal_hashlib_hash_get_digest_size (hashlib_hash_obj_t * self ) {
4842 if (self -> hash_type == MBEDTLS_SSL_HASH_SHA1 ) {
4943 return 20 ;
50- }
51- #if CIRCUITPY_HASHLIB_SHA256
52- else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
44+ } else if (self -> hash_type == MBEDTLS_SSL_HASH_SHA256 ) {
5345 return 32 ;
5446 }
55- #endif
56-
5747 return 0 ;
5848}
0 commit comments