MD.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /****************************************************************
  2. ****************************************************************
  3. ** **
  4. ** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. ** **
  6. ** All Rights Reserved. **
  7. ** **
  8. ** 6145-F, Northbelt Parkway, Norcross, **
  9. ** **
  10. ** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. ** **
  12. ****************************************************************
  13. ****************************************************************/
  14. /*****************************************************************
  15. *
  16. * MD.h
  17. * Message Digest Functions
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. * : Rama Bisa <ramab@ami.com>
  21. * : Basavaraj Astekar <basavaraja@ami.com>
  22. * : Bakka Ravinder Reddy <bakkar@ami.com>
  23. *
  24. *****************************************************************/
  25. #ifndef MD_H
  26. #define MD_H
  27. #include <stdint.h>
  28. #include "com_BmcType.h"
  29. #include "com_IPMIDefs.h"
  30. #pragma pack( 1 )
  31. /* Authentication Type */
  32. #define AUTH_TYPE_NONE 0
  33. #define AUTH_TYPE_MD2 1
  34. #define AUTH_TYPE_MD5 2
  35. #define AUTH_TYPE_PASSWORD 4
  36. #define AUTH_TYPE_OEM 5
  37. /* MD2Context_T */
  38. typedef struct
  39. {
  40. uint8_t State[16]; /* state */
  41. uint8_t Checksum[16]; /* checksum */
  42. uint8_t Count; /* number of bytes, modulo 16 */
  43. uint8_t Buffer[16]; /* input buffer */
  44. } MD2Context_T;
  45. /* MD5Context_T */
  46. typedef struct
  47. {
  48. uint32_t state[4]; /* state (ABCD) */
  49. uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
  50. uint8_t buffer[64]; /* input buffer */
  51. } MD5Context_T;
  52. #pragma pack( )
  53. /*--------------------------
  54. * Extern Declarations
  55. *--------------------------*/
  56. extern void AuthCodeCalMD2 ( uint8_t* String, uint8_t* MD2Result, uint8_t StrLen);
  57. extern void AuthCodeCalMD5 ( uint8_t* Str, uint8_t* MD5Result, uint16_t StrLen);
  58. #endif /* MD_H */