sec_hal.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (C) 2012 MediaTek, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #ifndef __MT_SEC_HAL_H__
  15. #define __MT_SEC_HAL_H__
  16. typedef enum {
  17. HACC_USER1 = 0,
  18. HACC_USER2,
  19. HACC_USER3,
  20. HACC_USER4
  21. } HACC_USER;
  22. int masp_hal_get_uuid(unsigned int *uuid);
  23. int masp_hal_sbc_enabled(void);
  24. int masp_hal_get_sbc_checksum(unsigned int *pChecksum);
  25. unsigned char masp_hal_secure_algo_init(void);
  26. unsigned char masp_hal_secure_algo_deinit(void);
  27. void masp_hal_secure_algo(unsigned char Direction, unsigned char *ContentAddr,
  28. unsigned int ContentLen, unsigned char *CustomSeed,
  29. unsigned char *ResText);
  30. unsigned int masp_hal_sp_hacc_init(unsigned char *sec_seed, unsigned int size);
  31. unsigned int masp_hal_sp_hacc_blk_sz(void);
  32. unsigned char *masp_hal_sp_hacc_enc(unsigned char *buf, unsigned int size, unsigned char bAC,
  33. HACC_USER user, unsigned char bDoLock);
  34. unsigned char *masp_hal_sp_hacc_dec(unsigned char *buf, unsigned int size, unsigned char bAC,
  35. HACC_USER user, unsigned char bDoLock);
  36. #endif /* !__MT_SEC_HAL_H__ */