sm3_x8_avx2.h 689 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the License); you may
  5. * not use this file except in compliance with the License.
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. */
  9. #ifndef GMSSL_SM3_X8_AVX2_H
  10. #define GMSSL_SM3_X8_AVX2_H
  11. #include <stdint.h>
  12. #include <immintrin.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. typedef struct {
  17. __m256i digest[8];
  18. } SM3_X8_CTX;
  19. void sm3_x8_init(SM3_X8_CTX *ctx);
  20. void sm3_x8_compress_blocks(__m256i digest[8], const uint8_t *data, size_t datalen);
  21. void sm3_x8_digest(const uint8_t *data, size_t datalen, uint8_t dgst[8][32]);
  22. #ifdef __cplusplus
  23. }
  24. #endif
  25. #endif