Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:15:32

0001 /* hmac-md5.h -- HMAC_MD5 functions
0002  */
0003 
0004 #ifndef HMAC_MD5_H
0005 #define HMAC_MD5_H 1
0006 
0007 #define HMAC_MD5_SIZE 16
0008 
0009 /* intermediate MD5 context */
0010 typedef struct HMAC_MD5_CTX_s {
0011     MD5_CTX ictx, octx;
0012 } HMAC_MD5_CTX;
0013 
0014 /* intermediate HMAC state
0015  *  values stored in network byte order (Big Endian)
0016  */
0017 typedef struct HMAC_MD5_STATE_s {
0018     UINT4 istate[4];
0019     UINT4 ostate[4];
0020 } HMAC_MD5_STATE;
0021 
0022 #ifdef __cplusplus
0023 extern "C" {
0024 #endif
0025 
0026 /* One step hmac computation
0027  *
0028  * digest may be same as text or key
0029  */
0030 void _sasl_hmac_md5(const unsigned char *text, int text_len,
0031             const unsigned char *key, int key_len,
0032             unsigned char digest[HMAC_MD5_SIZE]);
0033 
0034 /* create context from key
0035  */
0036 void _sasl_hmac_md5_init(HMAC_MD5_CTX *hmac,
0037              const unsigned char *key, int key_len);
0038 
0039 /* precalculate intermediate state from key
0040  */
0041 void _sasl_hmac_md5_precalc(HMAC_MD5_STATE *hmac,
0042                 const unsigned char *key, int key_len);
0043 
0044 /* initialize context from intermediate state
0045  */
0046 void _sasl_hmac_md5_import(HMAC_MD5_CTX *hmac, HMAC_MD5_STATE *state);
0047 
0048 #define _sasl_hmac_md5_update(hmac, text, text_len) _sasl_MD5Update(&(hmac)->ictx, (text), (text_len))
0049 
0050 /* finish hmac from intermediate result.  Intermediate result is zeroed.
0051  */
0052 void _sasl_hmac_md5_final(unsigned char digest[HMAC_MD5_SIZE],
0053               HMAC_MD5_CTX *hmac);
0054 
0055 #ifdef __cplusplus
0056 }
0057 #endif
0058 
0059 #endif /* HMAC_MD5_H */