cc_cipher.h 787 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
  3. /* \file cc_cipher.h
  4. * ARM CryptoCell Cipher Crypto API
  5. */
  6. #ifndef __CC_CIPHER_H__
  7. #define __CC_CIPHER_H__
  8. #include <linux/kernel.h>
  9. #include <crypto/algapi.h>
  10. #include "cc_driver.h"
  11. #include "cc_buffer_mgr.h"
  12. struct cipher_req_ctx {
  13. struct async_gen_req_ctx gen_ctx;
  14. enum cc_req_dma_buf_type dma_buf_type;
  15. u32 in_nents;
  16. u32 in_mlli_nents;
  17. u32 out_nents;
  18. u32 out_mlli_nents;
  19. u8 *iv;
  20. struct mlli_params mlli_params;
  21. };
  22. int cc_cipher_alloc(struct cc_drvdata *drvdata);
  23. int cc_cipher_free(struct cc_drvdata *drvdata);
  24. struct cc_hkey_info {
  25. u16 keylen;
  26. u8 hw_key1;
  27. u8 hw_key2;
  28. } __packed;
  29. #define CC_HW_KEY_SIZE sizeof(struct cc_hkey_info)
  30. #endif /*__CC_CIPHER_H__*/