~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib/hmac-md5.h

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef HMAC_MD5_H
2
 
#define HMAC_MD5_H
3
 
 
4
 
#include "md5.h"
5
 
 
6
 
#define CRAM_MD5_CONTEXTLEN 32
7
 
 
8
 
struct hmac_md5_context {
9
 
        struct md5_context ctx, ctxo;
10
 
};
11
 
 
12
 
void hmac_md5_init(struct hmac_md5_context *ctx,
13
 
                   const unsigned char *key, size_t key_len);
14
 
void hmac_md5_final(struct hmac_md5_context *ctx,
15
 
                    unsigned char digest[MD5_RESULTLEN]);
16
 
 
17
 
void hmac_md5_get_cram_context(struct hmac_md5_context *ctx,
18
 
                unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
19
 
void hmac_md5_set_cram_context(struct hmac_md5_context *ctx,
20
 
                const unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
21
 
 
22
 
 
23
 
static inline void
24
 
hmac_md5_update(struct hmac_md5_context *ctx, const void *data, size_t size)
25
 
{
26
 
        md5_update(&ctx->ctx, data, size);
27
 
}
28
 
 
29
 
#endif