dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libsasl / include / hmac-md5.h
blob9f9e907a9fffcb86461d4efc21bd809af6038bbf
1 /*
2 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 #pragma ident "%Z%%M% %I% %E% SMI"
8 /* hmac-md5.h -- HMAC_MD5 functions
9 */
11 #ifndef HMAC_MD5_H
12 #define HMAC_MD5_H 1
14 #define HMAC_MD5_SIZE 16
16 #ifdef _SUN_SDK_
17 #ifndef SASLPLUG_H
18 #include <sasl/saslplug.h>
19 #endif
20 #else
21 /* intermediate MD5 context */
22 typedef struct HMAC_MD5_CTX_s {
23 MD5_CTX ictx, octx;
24 } HMAC_MD5_CTX;
26 /* intermediate HMAC state
27 * values stored in network byte order (Big Endian)
29 typedef struct HMAC_MD5_STATE_s {
30 UINT4 istate[4];
31 UINT4 ostate[4];
32 } HMAC_MD5_STATE;
33 #endif /* _SUN_SDK */
35 /* One step hmac computation
37 * digest may be same as text or key
39 void _sasl_hmac_md5(const unsigned char *text, int text_len,
40 const unsigned char *key, int key_len,
41 unsigned char digest[HMAC_MD5_SIZE]);
43 /* create context from key
45 void _sasl_hmac_md5_init(HMAC_MD5_CTX *hmac,
46 const unsigned char *key, int key_len);
48 /* precalculate intermediate state from key
50 void _sasl_hmac_md5_precalc(HMAC_MD5_STATE *hmac,
51 const unsigned char *key, int key_len);
53 /* initialize context from intermediate state
55 void _sasl_hmac_md5_import(HMAC_MD5_CTX *hmac, HMAC_MD5_STATE *state);
57 #define _sasl_hmac_md5_update(hmac, text, text_len) _sasl_MD5Update(&(hmac)->ictx, (text), (text_len))
59 /* finish hmac from intermediate result. Intermediate result is zeroed.
61 void _sasl_hmac_md5_final(unsigned char digest[HMAC_MD5_SIZE],
62 HMAC_MD5_CTX *hmac);
64 #endif /* HMAC_MD5_H */