Lines Matching refs:hash
2 * Example computing a SHA-256 hash using the PSA Crypto API
4 * The example computes the SHA-256 hash of a test string using the
8 * devices where a rolling hash needs to be computed.
31 * the hash data in the EXAMPLE_HASH_VALUE macro below. */
62 uint8_t hash[PSA_HASH_LENGTH(HASH_ALG)];
75 /* Compute hash using multi-part operation */
78 mbedtls_printf("unknown hash algorithm supplied\n");
93 mbedtls_printf("PSA hash clone failed\n");
97 status = psa_hash_finish(&hash_operation, hash, sizeof(hash), &hash_length);
105 (memcmp(hash, expected_hash, expected_hash_len) != 0)) {
106 mbedtls_printf("Multi-part hash operation gave the wrong result!\n\n");
117 mbedtls_printf("Multi-part hash operation successful!\n");
120 /* Clear local variables prior to one-shot hash demo */
121 memset(hash, 0, sizeof(hash));
124 /* Compute hash using one-shot function call */
127 hash, sizeof(hash),
135 (memcmp(hash, expected_hash, expected_hash_len) != 0)) {
136 mbedtls_printf("One-shot hash operation gave the wrong result!\n\n");
140 mbedtls_printf("One-shot hash operation successful!\n\n");
146 mbedtls_printf("%02x", hash[j]);