| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| typedef struct test_data { |
| {0xdc96c23d, 0xaf36e268, 0xcb68ff71, 0xe92f76e2, 0xb8a8379d, 0x426dc745, |
| "Every one suspects himself of at least one of the cardinal virtues, and " |
| "this is mine: I am one of the few honest people that I have ever known"}; |
| int main(int argc, char **argv) { |
| uart_init(UART_BAUD_RATE); |
| uart_send_str("SHA256 test.\r\n"); |
| hmac_cfg_t setup = {.mode = HMAC_OP_SHA256, |
| hmac_update(test.sha_input, strlen(test.sha_input)); |
| for (uint32_t i = 0; i < 8; i++) { |
| if (digest.w[i] != test.digest[i]) { |
| REG32(FLASH_CTRL_SCRATCH(0)) = digest.w[i]; |
| uart_send_str("FAIL!\r\n"); |
| uart_send_str("PASS!\r\n"); |
| __asm__ volatile("wfi;"); |