Merge branch 'master' of ssh://git.samba.org/data/git/samba into selftest
[tprouty/samba.git] / lib / crypto / hmacsha256.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    Interface header:    HMAC SHA256 code
5
6    Copyright (C) Andrew Tridgell 2008
7
8    based on hmacsha1.h which is:
9
10     Copyright (C) Stefan Metzmacher 2006
11    
12    This program is free software; you can redistribute it and/or modify
13    it under the terms of the GNU General Public License as published by
14    the Free Software Foundation; either version 3 of the License, or
15    (at your option) any later version.
16    
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21    
22    You should have received a copy of the GNU General Public License
23    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #ifndef _HMAC_SHA256_H
27
28 struct HMACSHA256Context {
29         SHA256_CTX ctx;
30         uint8_t k_ipad[65];    
31         uint8_t k_opad[65];
32 };
33
34 void hmac_sha256_init(const uint8_t *key, size_t key_len, struct HMACSHA256Context *ctx);
35 void hmac_sha256_update(const uint8_t *data, size_t data_len, struct HMACSHA256Context *ctx);
36 void hmac_sha256_final(uint8_t digest[20], struct HMACSHA256Context *ctx);
37
38 #endif /* _HMAC_SHA256_H */