blob: 26972b9e92dbdaf2327364d46e7b2a22507b3ba6 [file] [log] [blame]
Thomas Gleixner40b0b3f2019-06-03 07:44:46 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Vivek Goyaldaeba0642014-08-08 14:25:59 -07002/*
3 * Copyright (C) 2014 Red Hat Inc.
4 *
5 * Author: Vivek Goyal <vgoyal@redhat.com>
Vivek Goyaldaeba0642014-08-08 14:25:59 -07006 */
7
8#ifndef SHA256_H
9#define SHA256_H
10
Vivek Goyaldaeba0642014-08-08 14:25:59 -070011#include <linux/types.h>
12#include <crypto/sha.h>
13
Philipp Rudodf6f2802018-04-13 15:36:46 -070014/*
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
Vivek Goyaldaeba0642014-08-08 14:25:59 -070023extern int sha256_init(struct sha256_state *sctx);
24extern int sha256_update(struct sha256_state *sctx, const u8 *input,
Philipp Rudodf6f2802018-04-13 15:36:46 -070025 unsigned int length);
Vivek Goyaldaeba0642014-08-08 14:25:59 -070026extern int sha256_final(struct sha256_state *sctx, u8 *hash);
27
28#endif /* SHA256_H */