This is an automated email from the ASF dual-hosted git repository.

kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 2a90596045b17f347d21a229e439a3b8d543121e
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Mon May 11 07:45:27 2026 +0200

    apps/hash_test: Update to mbedtls 3.6
    
    Code now uses mbedtls_sha256_starts, mbedtls_sha256_update
    and mbedtls_sha256_finish instead of deprecated versions:
    mbedtls_sha256_starts_ret, mbedtls_sha256_update_ret,
    mbedtls_sha256_finish_ret
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 apps/hash_test/src/main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/apps/hash_test/src/main.c b/apps/hash_test/src/main.c
index fd1a51f0b..7dd8a7e61 100755
--- a/apps/hash_test/src/main.c
+++ b/apps/hash_test/src/main.c
@@ -452,20 +452,19 @@ static void
 mbed_sha256_start(void *data, void *arg)
 {
     (void)arg;
-    (void)mbedtls_sha256_starts_ret((mbedtls_sha256_context *)data, 0);
+    (void)mbedtls_sha256_starts((mbedtls_sha256_context *)data, 0);
 }
 
 static void
 mbed_sha256_update(void *data, const uint8_t *input, uint32_t inlen)
 {
-    (void)mbedtls_sha256_update_ret((mbedtls_sha256_context *)data, input,
-            (uint16_t)inlen);
+    (void)mbedtls_sha256_update((mbedtls_sha256_context *)data, input, 
(uint16_t)inlen);
 }
 
 static void
 mbed_sha256_finish(void *data, uint8_t *output)
 {
-    (void)mbedtls_sha256_finish_ret((mbedtls_sha256_context *)data, output);
+    (void)mbedtls_sha256_finish((mbedtls_sha256_context *)data, output);
 }
 
 static void
@@ -513,7 +512,7 @@ run_sha256_benchmark(char *name, hash_start_func_t start_fn,
         printf("fail\n");
         return;
     }
-    printf("done in %lu ticks\n", os_time_get() - t);
+    printf("done in %lu ms\n", os_time_ticks_to_ms32(os_time_get() - t));
 }
 
 static void
@@ -621,6 +620,8 @@ mynewt_main(int argc, char **argv)
         os_time_delay(OS_TICKS_PER_SEC);
     }
 
+    mbedtls_sha256_free(&mbed_sha256);
+
     run_concurrency_test(hash);
 
     while (1) {

Reply via email to