~ubuntu-branches/ubuntu/utopic/libesmtp/utopic

« back to all changes in this revision

Viewing changes to crammd5/hmacmd5.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy T. Bouse
  • Date: 2002-03-06 08:37:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020306083748-ihmt32mddsslvg5i
Tags: upstream-0.8.11
ImportĀ upstreamĀ versionĀ 0.8.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _hmac_md5_h
 
2
#define _hmac_md5_h
 
3
/*
 
4
 *  This file is part of libESMTP, a library for submission of RFC 2822
 
5
 *  formatted electronic mail messages using the SMTP protocol described
 
6
 *  in RFC 2821.
 
7
 *
 
8
 *  Copyright (C) 2001,2002  Brian Stafford  <brian@stafford.uklinux.net>
 
9
 *
 
10
 *  This library is free software; you can redistribute it and/or
 
11
 *  modify it under the terms of the GNU Lesser General Public
 
12
 *  License as published by the Free Software Foundation; either
 
13
 *  version 2.1 of the License, or (at your option) any later version.
 
14
 *
 
15
 *  This library is distributed in the hope that it will be useful,
 
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
 *  Lesser General Public License for more details.
 
19
 *
 
20
 *  You should have received a copy of the GNU Lesser General Public
 
21
 *  License along with this library; if not, write to the Free Software
 
22
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#if HAVE_LIBCRYPTO
 
26
 
 
27
#include <openssl/md5.h>
 
28
 
 
29
#else
 
30
 
 
31
#include "md5.h"
 
32
 
 
33
#define MD5_CTX                 MD5Context
 
34
#define MD5_Init(c)             md5_init((c))
 
35
#define MD5_Update(c,d,l)       md5_update((c),(d),(l))
 
36
#define MD5_Final(md,c)         md5_final((c),(md))
 
37
 
 
38
#endif
 
39
 
 
40
/* Precompute HMAC-MD5 contexts from a secret. */
 
41
void hmac_md5_pre (const void *secret, size_t secret_len,
 
42
                   MD5_CTX *inner, MD5_CTX *outer);
 
43
/* Finalise HMAC-MD5 contexts from a challenge.  */
 
44
void hmac_md5_post (const void *challenge, size_t challenge_len,
 
45
                    MD5_CTX *inner, MD5_CTX *outer, unsigned char digest[16]);
 
46
/* Digest a challenge and a secret.  */
 
47
void hmac_md5 (const void *challenge, size_t challenge_len,
 
48
               const void *secret, size_t secret_len,
 
49
               unsigned char digest[16]);
 
50
 
 
51
#endif