Thomas Gleixner | 40b0b3f | 2019-06-03 07:44:46 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Vivek Goyal | daeba064 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2014 Red Hat Inc. |
| 4 | * |
| 5 | * Author: Vivek Goyal <vgoyal@redhat.com> |
Vivek Goyal | daeba064 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef SHA256_H |
| 9 | #define SHA256_H |
| 10 | |
Vivek Goyal | daeba064 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 11 | #include <linux/types.h> |
| 12 | #include <crypto/sha.h> |
| 13 | |
Philipp Rudo | df6f280 | 2018-04-13 15:36:46 -0700 | [diff] [blame] | 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 | |
Vivek Goyal | daeba064 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 23 | extern int sha256_init(struct sha256_state *sctx); |
| 24 | extern int sha256_update(struct sha256_state *sctx, const u8 *input, |
Philipp Rudo | df6f280 | 2018-04-13 15:36:46 -0700 | [diff] [blame] | 25 | unsigned int length); |
Vivek Goyal | daeba064 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 26 | extern int sha256_final(struct sha256_state *sctx, u8 *hash); |
| 27 | |
| 28 | #endif /* SHA256_H */ |