cmll_platform.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2019-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. #ifndef OSSL_CMLL_PLATFORM_H
  10. # define OSSL_CMLL_PLATFORM_H
  11. # pragma once
  12. # if defined(CMLL_ASM) && (defined(__sparc) || defined(__sparc__))
  13. /* Fujitsu SPARC64 X support */
  14. extern unsigned int OPENSSL_sparcv9cap_P[];
  15. # include "sparc_arch.h"
  16. # ifndef OPENSSL_NO_CAMELLIA
  17. # define SPARC_CMLL_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_CAMELLIA)
  18. # include <openssl/camellia.h>
  19. void cmll_t4_set_key(const unsigned char *key, int bits, CAMELLIA_KEY *ks);
  20. void cmll_t4_encrypt(const unsigned char *in, unsigned char *out,
  21. const CAMELLIA_KEY *key);
  22. void cmll_t4_decrypt(const unsigned char *in, unsigned char *out,
  23. const CAMELLIA_KEY *key);
  24. void cmll128_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
  25. size_t len, const CAMELLIA_KEY *key,
  26. unsigned char *ivec, int /*unused*/);
  27. void cmll128_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
  28. size_t len, const CAMELLIA_KEY *key,
  29. unsigned char *ivec, int /*unused*/);
  30. void cmll256_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
  31. size_t len, const CAMELLIA_KEY *key,
  32. unsigned char *ivec, int /*unused*/);
  33. void cmll256_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
  34. size_t len, const CAMELLIA_KEY *key,
  35. unsigned char *ivec, int /*unused*/);
  36. void cmll128_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
  37. size_t blocks, const CAMELLIA_KEY *key,
  38. unsigned char *ivec);
  39. void cmll256_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
  40. size_t blocks, const CAMELLIA_KEY *key,
  41. unsigned char *ivec);
  42. # endif /* OPENSSL_NO_CAMELLIA */
  43. # endif /* CMLL_ASM && sparc */
  44. #endif /* OSSL_CRYPTO_CIPHERMODE_PLATFORM_H */