cc_cipher.h 838 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2012-2018 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 *backup_info; /*store iv for generated IV flow*/
  20. u8 *iv;
  21. struct mlli_params mlli_params;
  22. };
  23. int cc_cipher_alloc(struct cc_drvdata *drvdata);
  24. int cc_cipher_free(struct cc_drvdata *drvdata);
  25. struct cc_hkey_info {
  26. u16 keylen;
  27. u8 hw_key1;
  28. u8 hw_key2;
  29. } __packed;
  30. #define CC_HW_KEY_SIZE sizeof(struct cc_hkey_info)
  31. #endif /*__CC_CIPHER_H__*/