fsl_hash.h 634 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014 Freescale Semiconductor, Inc.
  4. *
  5. */
  6. #ifndef _SHA_H
  7. #define _SHA_H
  8. #include <fsl_sec.h>
  9. #include <hash.h>
  10. #include "jr.h"
  11. /* We support at most 32 Scatter/Gather Entries.*/
  12. #define MAX_SG_32 32
  13. /*
  14. * Hash context contains the following fields
  15. * @sha_desc: Sha Descriptor
  16. * @sg_num: number of entries in sg table
  17. * @len: total length of buffer
  18. * @sg_tbl: sg entry table
  19. * @hash: index to the hash calculated
  20. */
  21. struct sha_ctx {
  22. uint32_t sha_desc[64];
  23. uint32_t sg_num;
  24. uint32_t len;
  25. struct sg_entry sg_tbl[MAX_SG_32];
  26. u8 hash[HASH_MAX_DIGEST_SIZE];
  27. };
  28. #endif