Vivek Goyal | daeba06 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 Red Hat Inc. |
| 3 | * |
| 4 | * Author: Vivek Goyal <vgoyal@redhat.com> |
| 5 | * |
| 6 | * This source code is licensed under the GNU General Public License, |
| 7 | * Version 2. See the file COPYING for more details. |
| 8 | */ |
| 9 | |
| 10 | #ifndef SHA256_H |
| 11 | #define SHA256_H |
| 12 | |
Vivek Goyal | daeba06 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 13 | #include <linux/types.h> |
| 14 | #include <crypto/sha.h> |
| 15 | |
Philipp Rudo | df6f280 | 2018-04-13 15:36:46 -0700 | [diff] [blame] | 16 | /* |
| 17 | * Stand-alone implementation of the SHA256 algorithm. It is designed to |
| 18 | * have as little dependencies as possible so it can be used in the |
| 19 | * kexec_file purgatory. In other cases you should use the implementation in |
| 20 | * crypto/. |
| 21 | * |
| 22 | * For details see lib/sha256.c |
| 23 | */ |
| 24 | |
Vivek Goyal | daeba06 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 25 | extern int sha256_init(struct sha256_state *sctx); |
| 26 | extern int sha256_update(struct sha256_state *sctx, const u8 *input, |
Philipp Rudo | df6f280 | 2018-04-13 15:36:46 -0700 | [diff] [blame] | 27 | unsigned int length); |
Vivek Goyal | daeba06 | 2014-08-08 14:25:59 -0700 | [diff] [blame] | 28 | extern int sha256_final(struct sha256_state *sctx, u8 *hash); |
| 29 | |
| 30 | #endif /* SHA256_H */ |