at v5.3 724 B view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (C) 2014 Red Hat Inc. 4 * 5 * Author: Vivek Goyal <vgoyal@redhat.com> 6 */ 7 8#ifndef SHA256_H 9#define SHA256_H 10 11#include <linux/types.h> 12#include <crypto/sha.h> 13 14/* 15 * Stand-alone implementation of the SHA256 algorithm. It is designed to 16 * have as little dependencies as possible so it can be used in the 17 * kexec_file purgatory. In other cases you should use the implementation in 18 * crypto/. 19 * 20 * For details see lib/sha256.c 21 */ 22 23extern int sha256_init(struct sha256_state *sctx); 24extern int sha256_update(struct sha256_state *sctx, const u8 *input, 25 unsigned int length); 26extern int sha256_final(struct sha256_state *sctx, u8 *hash); 27 28#endif /* SHA256_H */