cmll_platform.h 2.2 KB

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