X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=hfal%2Fhfal-hmac.h;fp=hfal%2Fhfal-hmac.h;h=8c9b8991f179efe24745e2fe0245abb2360731bf;hb=d70d1d77bab1a5f5278227d674bc59da0378fe15;hp=0000000000000000000000000000000000000000;hpb=d00ed9a275c69fa3512007452e479abd98dbe745;p=arm-crypto-lib.git diff --git a/hfal/hfal-hmac.h b/hfal/hfal-hmac.h new file mode 100644 index 0000000..8c9b899 --- /dev/null +++ b/hfal/hfal-hmac.h @@ -0,0 +1,41 @@ +/* hfal-hmac.h */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef HFAL_HMAC_H_ +#define HFAL_HMAC_H_ + +#include +#include "hashfunction_descriptor.h" + +typedef struct { + hfdesc_t* desc; + void* ctx; + void* finctx; +} hfhmacgen_ctx_t; + +uint8_t hfal_hmac_init(const hfdesc_t* hash_descriptor, hfhmacgen_ctx_t* ctx, const void* key, uint16_t keylength_b); +void hfal_hmac_nextBlock(hfhmacgen_ctx_t* ctx, const void* block); +void hfal_hmac_lastBlock(hfhmacgen_ctx_t* ctx, const void* block, uint16_t length_b); +void hfal_hmac_ctx2mac(void* dest, hfhmacgen_ctx_t* ctx); +void hfal_hmac_free(hfhmacgen_ctx_t* ctx); +void hfal_hmac_mem(const hfdesc_t* hash_descriptor, const void* key, uint16_t keylength_b, void* dest, const void* msg, uint32_t length_b); +uint16_t hfal_hmac_getBlocksize(const hfdesc_t* hash_descriptor); +uint16_t hfal_hmac_getMACsize(const hfdesc_t* hash_descriptor); + +#endif /* HFAL_HMAC_H_ */