Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CyaSSL by
hmac.h
00001 /* hmac.h 00002 * 00003 * Copyright (C) 2013 wolfSSL Inc. 00004 * 00005 * This file is part of CyaSSL. 00006 * 00007 * CyaSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * CyaSSL is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00020 */ 00021 00022 00023 /* hmac.h defines mini hamc openssl compatibility layer 00024 * 00025 */ 00026 00027 00028 #ifndef CYASSL_HMAC_H_ 00029 #define CYASSL_HMAC_H_ 00030 00031 #include <cyassl/ctaocrypt/settings.h> 00032 00033 #ifdef YASSL_PREFIX 00034 #include "prefix_hmac.h" 00035 #endif 00036 00037 #include <cyassl/openssl/evp.h> 00038 #include <cyassl/ctaocrypt/hmac.h> 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 00045 CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md, 00046 const void* key, int key_len, 00047 const unsigned char* d, int n, unsigned char* md, 00048 unsigned int* md_len); 00049 00050 00051 typedef struct CYASSL_HMAC_CTX { 00052 Hmac hmac; 00053 int type; 00054 } CYASSL_HMAC_CTX; 00055 00056 00057 CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key, 00058 int keylen, const EVP_MD* type); 00059 CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx, 00060 const unsigned char* data, int len); 00061 CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash, 00062 unsigned int* len); 00063 CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx); 00064 00065 00066 typedef struct CYASSL_HMAC_CTX HMAC_CTX; 00067 00068 #define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g)) 00069 00070 #define HMAC_Init CyaSSL_HMAC_Init 00071 #define HMAC_Update CyaSSL_HMAC_Update 00072 #define HMAC_Final CyaSSL_HMAC_Final 00073 #define HMAC_cleanup CyaSSL_HMAC_cleanup 00074 00075 00076 #ifdef __cplusplus 00077 } /* extern "C" */ 00078 #endif 00079 00080 00081 #endif /* CYASSL_HMAC_H_ */ 00082
Generated on Tue Jul 12 2022 21:40:04 by
1.7.2
