sha256.h 807 B

12345678910111213141516171819202122232425262728293031
  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. #ifndef SHA256_H
  10. #define SHA256_H
  11. #include <linux/types.h>
  12. #include <crypto/sha.h>
  13. /*
  14. * Stand-alone implementation of the SHA256 algorithm. It is designed to
  15. * have as little dependencies as possible so it can be used in the
  16. * kexec_file purgatory. In other cases you should use the implementation in
  17. * crypto/.
  18. *
  19. * For details see lib/sha256.c
  20. */
  21. extern int sha256_init(struct sha256_state *sctx);
  22. extern int sha256_update(struct sha256_state *sctx, const u8 *input,
  23. unsigned int length);
  24. extern int sha256_final(struct sha256_state *sctx, u8 *hash);
  25. #endif /* SHA256_H */