1/* 2 * Copyright 2017, DornerWorks 3 * 4 * SPDX-License-Identifier: GPL-2.0-only 5 * 6 * This data was produced by DornerWorks, Ltd. of Grand Rapids, MI, USA under 7 * a DARPA SBIR, Contract Number D16PC00107. 8 * 9 * Approved for Public Release, Distribution Unlimited. 10 * 11 */ 12 13#pragma once 14 15#ifdef __cplusplus 16extern "C" { 17#endif 18 19typedef struct { 20 uint64_t len; /* processed message length */ 21 uint32_t h[8]; /* hash state */ 22 uint8_t buf[64]; /* message block buffer */ 23} sha256_t; 24 25void sha256_init(sha256_t *s); 26void sha256_sum(sha256_t *s, uint8_t *md); 27void sha256_update(sha256_t *s, const void *m, unsigned long len); 28 29#ifdef __cplusplus 30} 31#endif 32 33