cipher_aes_ccm_hw_t4.inc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright 2001-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. /*-
  10. * Fujitsu SPARC64 X support for AES CCM.
  11. * This file is included by cipher_aes_ccm_hw.c
  12. */
  13. static int ccm_t4_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
  14. size_t keylen)
  15. {
  16. PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
  17. AES_HW_CCM_SET_KEY_FN(aes_t4_set_encrypt_key, aes_t4_encrypt, NULL, NULL);
  18. return 1;
  19. }
  20. static const PROV_CCM_HW t4_aes_ccm = {
  21. ccm_t4_aes_initkey,
  22. ossl_ccm_generic_setiv,
  23. ossl_ccm_generic_setaad,
  24. ossl_ccm_generic_auth_encrypt,
  25. ossl_ccm_generic_auth_decrypt,
  26. ossl_ccm_generic_gettag
  27. };
  28. const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
  29. {
  30. return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
  31. }