sec_auth.h 1.1 KB

12345678910111213141516171819202122232425
  1. #ifndef SEC_AUTH_H
  2. #define SEC_AUTH_H
  3. /**************************************************************************
  4. * AUTH DATA STRUCTURE
  5. **************************************************************************/
  6. #define SIGNATURE_SIZE (128)
  7. #define RSA_KEY_SIZE (128)
  8. typedef struct {
  9. unsigned char content[SIGNATURE_SIZE];
  10. } _signature;
  11. /**************************************************************************
  12. * EXPORT FUNCTION
  13. **************************************************************************/
  14. extern int lib_init_key(unsigned char *nKey, unsigned int nKey_len, unsigned char *eKey,
  15. unsigned int eKey_len);
  16. extern int lib_sign(unsigned char *data_buf, unsigned int data_len, unsigned char *sig_buf, unsigned int sig_len);
  17. extern int lib_hash(unsigned char *data_buf, unsigned int data_len, unsigned char *hash_buf, unsigned int hash_len);
  18. extern int lib_verify(unsigned char *data_buf, unsigned int data_len, unsigned char *sig_buf,
  19. unsigned int sig_len);
  20. extern int sec_auth_test(void);
  21. #endif /* SEC_AUTH_H */