qcryptoi.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* QTI Crypto driver
  2. *
  3. * Copyright (c) 2014, The Linux Foundation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 and
  7. * only version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef __CRYPTO_MSM_QCRYPTOI_H
  15. #define __CRYPTO_MSM_QCRYPTOI_H
  16. /* FIPS global status variable */
  17. extern enum fips_status g_fips140_status;
  18. /* The structure to hold data
  19. * that selftests require
  20. */
  21. struct fips_selftest_data {
  22. char algo_prefix[10];
  23. unsigned int ce_device;
  24. bool prefix_ahash_algo;
  25. bool prefix_hmac_algo;
  26. bool prefix_aes_xts_algo;
  27. bool prefix_aes_cbc_ecb_ctr_algo;
  28. bool prefix_aead_algo;
  29. };
  30. #ifdef CONFIG_FIPS_ENABLE
  31. /*
  32. * Sha/HMAC self tests
  33. */
  34. int _fips_qcrypto_sha_selftest(struct fips_selftest_data *selftest_d);
  35. /*
  36. * Cipher algorithm self tests
  37. */
  38. int _fips_qcrypto_cipher_selftest(struct fips_selftest_data *selftest_d);
  39. /*
  40. * AEAD algorithm self tests
  41. */
  42. int _fips_qcrypto_aead_selftest(struct fips_selftest_data *selftest_d);
  43. #else
  44. static inline
  45. int _fips_qcrypto_sha_selftest(struct fips_selftest_data *selftest_d)
  46. {
  47. return 0;
  48. }
  49. static inline
  50. int _fips_qcrypto_cipher_selftest(struct fips_selftest_data *selftest_d)
  51. {
  52. return 0;
  53. }
  54. static
  55. inline int _fips_qcrypto_aead_selftest(struct fips_selftest_data *selftest_d)
  56. {
  57. return 0;
  58. }
  59. #endif /* CONFIG_FIPS_ENABLE*/
  60. #endif /* __CRYPTO_MSM_QCRYPTOI_H */