annotate hmac-sha1.h @ 42:082c8294c86b

get rid of hmac message padding and aes hmac
author Matt Johnston <matt@ucc.asn.au>
date Sat, 29 Jun 2013 10:36:41 +0800
parents 8705acff2494
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 /* hmac-sha1.h */
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2 /*
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 This file is part of the AVR-Crypto-Lib.
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 Copyright (C) 2008 Daniel Otte ([email protected])
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 This program is free software: you can redistribute it and/or modify
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 the Free Software Foundation, either version 3 of the License, or
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9 (at your option) any later version.
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 GNU General Public License for more details.
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 */
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19 #ifndef HMACSHA1_H_
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 #define HMACSHA1_H_
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 #include "sha1.h"
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 #define HMAC_SHA1_BITS SHA1_HASH_BITS
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25 #define HMAC_SHA1_BYTES SHA1_HASH_BYTES
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 #define HMAC_SHA1_BLOCK_BITS SHA1_BLOCK_BITS
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 #define HMAC_SHA1_BLOCK_BYTES SHA1_BLOCK_BYTES
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
28
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 typedef struct{
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30 sha1_ctx_t a, b;
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 } hmac_sha1_ctx_t;
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34 void hmac_sha1_init(hmac_sha1_ctx_t *s, const void* key, uint16_t keylength_b);
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 void hmac_sha1_nextBlock(hmac_sha1_ctx_t *s, const void* block);
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 void hmac_sha1_lastBlock(hmac_sha1_ctx_t *s, const void* block, uint16_t length_b);
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 void hmac_sha1_final(void* dest, hmac_sha1_ctx_t *s);
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 void hmac_sha1(void* dest, const void* key, uint16_t keylength_b, const void* msg, uint32_t msglength_b);
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40
8705acff2494 lots of stuff
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41 #endif /*HMACSHA1_H_*/