ccRTP 2.1.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hmac.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005, 2004, 2010 Erik Eliasson, Johan Bilien, Werner Dittmann
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18  * In addition, as a special exception, the copyright holders give
19  * permission to link the code of portions of this program with the
20  * OpenSSL library under certain conditions as described in each
21  * individual source file, and distribute linked combinations
22  * including the two.
23  * You must obey the GNU General Public License in all respects
24  * for all of the code used other than OpenSSL. If you modify
25  * file(s) with this exception, you may extend this exception to your
26  * version of the file(s), but you are not obligated to do so. If you
27  * do not wish to do so, delete this exception statement from your
28  * version. If you delete this exception statement from all source
29  * files in the program, then also delete it here.
30  */
31 
40 #ifndef HMAC_H
41 #define HMAC_H
42 
51 #include <stdint.h>
52 
53 #ifndef SHA1_DIGEST_LENGTH
54 #define SHA1_DIGEST_LENGTH 20
55 #endif
56 
77 void hmac_sha1( uint8_t* key, int32_t key_length,
78  const uint8_t* data, uint32_t data_length,
79  uint8_t* mac, int32_t* mac_length );
80 
101 void hmac_sha1( uint8_t* key, int32_t key_length,
102  const uint8_t* data[], uint32_t data_length[],
103  uint8_t* mac, int32_t* mac_length );
104 
116 void* createSha1HmacContext(uint8_t* key, int32_t key_length);
117 
136 void hmacSha1Ctx(void* ctx, const uint8_t* data, uint32_t data_length,
137  uint8_t* mac, int32_t* mac_length );
138 
158 void hmacSha1Ctx(void* ctx, const uint8_t* data[], uint32_t data_length[],
159  uint8_t* mac, int32_t* mac_length );
160 
166 void freeSha1HmacContext(void* ctx);
167 
168 
172 #endif
void hmacSha1Ctx(void *ctx, const uint8_t *data, uint32_t data_length, uint8_t *mac, int32_t *mac_length)
Compute SHA1 HMAC.
Definition: gcrypthmac.cpp:79
void freeSha1HmacContext(void *ctx)
Free SHA1 HMAC context.
Definition: gcrypthmac.cpp:113
void hmac_sha1(uint8_t *key, int32_t key_length, const uint8_t *data, uint32_t data_length, uint8_t *mac, int32_t *mac_length)
Compute SHA1 HMAC.
Definition: hmac.cpp:42
void * createSha1HmacContext(uint8_t *key, int32_t key_length)
Create and initialize a SHA1 HMAC context.
Definition: gcrypthmac.cpp:70