1 /* 2 * ex: set tabstop=4 ai expandtab softtabstop=4 shiftwidth=4: 3 * -*- mode: c-basic-indent: 4; tab-width: 4; indent-tabls-mode: nil -*- 4 * $Id: hmac-sha1.h 207 2009-07-11 23:06:58Z boote $ 5 */ 6 /************************************************************************ 7 * * 8 * Copyright (C) 2006 * 9 * Internet2 * 10 * All Rights Reserved * 11 * * 12 ************************************************************************/ 13 /* 14 * File: hmac-sha1.h 15 * 16 * Author: Jeff W. Boote 17 * Internet2 18 * 19 * Date: Sat Oct 07 12:33:33 MDT 2006 20 * 21 * Description: 22 */ 23 #ifndef I2HMAC_SHA1_H 24 #define I2HMAC_SHA1_H 25 26 #include <I2util/util.h> 27 #include <I2util/sha1.h> 28 29 BEGIN_C_DECLS 30 31 #define I2HMAC_SHA1_DIGEST_SIZE 20 32 #define I2HMAC_SHA1_BLOCK_SIZE 64 33 34 struct I2HMACSha1ContextRec; 35 typedef struct I2HMACSha1ContextRec *I2HMACSha1Context; 36 37 extern I2HMACSha1Context 38 I2HMACSha1Alloc( 39 I2ErrHandle eh 40 ); 41 extern void I2HMACSha1Free( 42 I2HMACSha1Context hmac 43 ); 44 extern void I2HMACSha1Init( 45 I2HMACSha1Context hmac, 46 const uint8_t *key, 47 uint32_t len 48 ); 49 extern void I2HMACSha1Append( 50 I2HMACSha1Context hmac, 51 const uint8_t *txt, 52 uint32_t len 53 ); 54 extern void I2HMACSha1Finish( 55 I2HMACSha1Context hmac, 56 uint8_t *digest_ret /* I2HMAC_SHA1_DIGEST_SIZE */ 57 ); 58 extern void I2HMACSha1( 59 const uint8_t *key, 60 uint32_t keylen, 61 const uint8_t *txt, 62 uint32_t txtlen, 63 uint8_t *digest_ret 64 ); 65 66 END_C_DECLS 67 68 #endif /* I2HMAC_SHA1_H */ 69