ARM Shanghai IoT Team (Internal) / newMiniTLS-GPL

Fork of MiniTLS-GPL by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers crypto_hmac_sha256.h Source File

crypto_hmac_sha256.h

Go to the documentation of this file.
00001 /*
00002 MiniTLS - A super trimmed down TLS/SSL Library for embedded devices
00003 Author: Donatien Garnier
00004 Copyright (C) 2013-2014 AppNearMe Ltd
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019 *//**
00020  * \file crypto_hmac_sha256.h
00021  * \copyright Copyright (c) AppNearMe Ltd 2013
00022  * \author Donatien Garnier
00023  */
00024 
00025 #ifndef CRYPTO_HMAC_SHA256_H_
00026 #define CRYPTO_HMAC_SHA256_H_
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 #include "core/fwk.h"
00033 #include "crypto_sha256.h"
00034 
00035 #define HMAC_SHA256_SIZE SHA256_SIZE //Same size that underlying hash function
00036 
00037 typedef struct __crypto_hmac_sha256
00038 {
00039   crypto_sha256_t hash;
00040   uint8_t key_pad[64];
00041 } crypto_hmac_sha256_t;
00042 
00043 void crypto_hmac_sha256_init(crypto_hmac_sha256_t* mac, const uint8_t* key, size_t size);
00044 void crypto_hmac_sha256_update(crypto_hmac_sha256_t* mac, const uint8_t* data, size_t size);
00045 void crypto_hmac_sha256_end(crypto_hmac_sha256_t* mac, uint8_t* out);
00046 
00047 
00048 #ifdef __cplusplus
00049 }
00050 #endif
00051 
00052 #endif /* CRYPTO_HMAC_SHA256_H_ */