versadac  1
versadac - Scalable Recorder Firmware
hmac-sha256.h
1 /* hmac-sha256.h */
2 /*
3  This file is part of the AVR-Crypto-Lib.
4  Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef HMACSHA256_H_
20 #define HMACSHA256_H_
21 
22 #include "openssl/sha.h"
23 
24 #define SHA256_BLOCK_BYTES 64
25 #define HMAC_SHA256_DIGEST_LENGTH SHA256_DIGEST_LENGTH
26 #define HMAC_SHA256_KEY_LENGTH 64
27 
28 
29 // https://gist.github.com/112188/acdbf002acf454bd60c355a776b9a5b58b6dff5e
30 
31 void hmac_sha256( const unsigned char *text, /* pointer to data stream */
32  int text_len, /* length of data stream */
33  const unsigned char *key, /* pointer to authentication key */
34  int key_len, /* length of authentication key */
35  void *digest); /* caller digest to be filled in */
36 
37 
38 #endif /*HMACSHA256_H_*/