This is a port of cyaSSL 2.7.0.

Dependents:   CyaSSL_DTLS_Cellular CyaSSL_DTLS_Ethernet

Committer:
ashleymills
Date:
Thu Sep 05 15:55:50 2013 +0000
Revision:
1:c0ce1562443a
Parent:
0:714293de3836
Nothing;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ashleymills 0:714293de3836 1 /* hmac.h
ashleymills 0:714293de3836 2 *
ashleymills 0:714293de3836 3 * Copyright (C) 2013 wolfSSL Inc.
ashleymills 0:714293de3836 4 *
ashleymills 0:714293de3836 5 * This file is part of CyaSSL.
ashleymills 0:714293de3836 6 *
ashleymills 0:714293de3836 7 * CyaSSL is free software; you can redistribute it and/or modify
ashleymills 0:714293de3836 8 * it under the terms of the GNU General Public License as published by
ashleymills 0:714293de3836 9 * the Free Software Foundation; either version 2 of the License, or
ashleymills 0:714293de3836 10 * (at your option) any later version.
ashleymills 0:714293de3836 11 *
ashleymills 0:714293de3836 12 * CyaSSL is distributed in the hope that it will be useful,
ashleymills 0:714293de3836 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ashleymills 0:714293de3836 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ashleymills 0:714293de3836 15 * GNU General Public License for more details.
ashleymills 0:714293de3836 16 *
ashleymills 0:714293de3836 17 * You should have received a copy of the GNU General Public License
ashleymills 0:714293de3836 18 * along with this program; if not, write to the Free Software
ashleymills 0:714293de3836 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
ashleymills 0:714293de3836 20 */
ashleymills 0:714293de3836 21
ashleymills 0:714293de3836 22
ashleymills 0:714293de3836 23 /* hmac.h defines mini hamc openssl compatibility layer
ashleymills 0:714293de3836 24 *
ashleymills 0:714293de3836 25 */
ashleymills 0:714293de3836 26
ashleymills 0:714293de3836 27
ashleymills 0:714293de3836 28 #ifndef CYASSL_HMAC_H_
ashleymills 0:714293de3836 29 #define CYASSL_HMAC_H_
ashleymills 0:714293de3836 30
ashleymills 0:714293de3836 31 #include <cyassl/ctaocrypt/settings.h>
ashleymills 0:714293de3836 32
ashleymills 0:714293de3836 33 #ifdef YASSL_PREFIX
ashleymills 0:714293de3836 34 #include "prefix_hmac.h"
ashleymills 0:714293de3836 35 #endif
ashleymills 0:714293de3836 36
ashleymills 0:714293de3836 37 #include <cyassl/openssl/evp.h>
ashleymills 0:714293de3836 38 #include <cyassl/ctaocrypt/hmac.h>
ashleymills 0:714293de3836 39
ashleymills 0:714293de3836 40 #ifdef __cplusplus
ashleymills 0:714293de3836 41 extern "C" {
ashleymills 0:714293de3836 42 #endif
ashleymills 0:714293de3836 43
ashleymills 0:714293de3836 44
ashleymills 0:714293de3836 45 CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md,
ashleymills 0:714293de3836 46 const void* key, int key_len,
ashleymills 0:714293de3836 47 const unsigned char* d, int n, unsigned char* md,
ashleymills 0:714293de3836 48 unsigned int* md_len);
ashleymills 0:714293de3836 49
ashleymills 0:714293de3836 50
ashleymills 0:714293de3836 51 typedef struct CYASSL_HMAC_CTX {
ashleymills 0:714293de3836 52 Hmac hmac;
ashleymills 0:714293de3836 53 int type;
ashleymills 0:714293de3836 54 } CYASSL_HMAC_CTX;
ashleymills 0:714293de3836 55
ashleymills 0:714293de3836 56
ashleymills 0:714293de3836 57 CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key,
ashleymills 0:714293de3836 58 int keylen, const EVP_MD* type);
ashleymills 0:714293de3836 59 CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx,
ashleymills 0:714293de3836 60 const unsigned char* data, int len);
ashleymills 0:714293de3836 61 CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash,
ashleymills 0:714293de3836 62 unsigned int* len);
ashleymills 0:714293de3836 63 CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx);
ashleymills 0:714293de3836 64
ashleymills 0:714293de3836 65
ashleymills 0:714293de3836 66 typedef struct CYASSL_HMAC_CTX HMAC_CTX;
ashleymills 0:714293de3836 67
ashleymills 0:714293de3836 68 #define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
ashleymills 0:714293de3836 69
ashleymills 0:714293de3836 70 #define HMAC_Init CyaSSL_HMAC_Init
ashleymills 0:714293de3836 71 #define HMAC_Update CyaSSL_HMAC_Update
ashleymills 0:714293de3836 72 #define HMAC_Final CyaSSL_HMAC_Final
ashleymills 0:714293de3836 73 #define HMAC_cleanup CyaSSL_HMAC_cleanup
ashleymills 0:714293de3836 74
ashleymills 0:714293de3836 75
ashleymills 0:714293de3836 76 #ifdef __cplusplus
ashleymills 0:714293de3836 77 } /* extern "C" */
ashleymills 0:714293de3836 78 #endif
ashleymills 0:714293de3836 79
ashleymills 0:714293de3836 80
ashleymills 0:714293de3836 81 #endif /* CYASSL_HMAC_H_ */