sha_ppc.c 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <openssl/opensslconf.h>
  12. #include <openssl/sha.h>
  13. #include "crypto/ppc_arch.h"
  14. void sha256_block_p8(void *ctx, const void *inp, size_t len);
  15. void sha256_block_ppc(void *ctx, const void *inp, size_t len);
  16. void sha256_block_data_order(void *ctx, const void *inp, size_t len);
  17. void sha256_block_data_order(void *ctx, const void *inp, size_t len)
  18. {
  19. OPENSSL_ppccap_P & PPC_CRYPTO207 ? sha256_block_p8(ctx, inp, len) :
  20. sha256_block_ppc(ctx, inp, len);
  21. }
  22. void sha512_block_p8(void *ctx, const void *inp, size_t len);
  23. void sha512_block_ppc(void *ctx, const void *inp, size_t len);
  24. void sha512_block_data_order(void *ctx, const void *inp, size_t len);
  25. void sha512_block_data_order(void *ctx, const void *inp, size_t len)
  26. {
  27. OPENSSL_ppccap_P & PPC_CRYPTO207 ? sha512_block_p8(ctx, inp, len) :
  28. sha512_block_ppc(ctx, inp, len);
  29. }