wolfSSL 3.11.1 for TLS1.3 beta
Fork of wolfSSL by
wolfssl/openssl/hmac.h@13:80fb167dafdf, 2017-05-30 (annotated)
- Committer:
- wolfSSL
- Date:
- Tue May 30 06:16:19 2017 +0000
- Revision:
- 13:80fb167dafdf
- Parent:
- 11:cee25a834751
wolfSSL 3.11.1: TLS1.3 Beta
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 11:cee25a834751 | 1 | /* hmac.h |
wolfSSL | 11:cee25a834751 | 2 | * |
wolfSSL | 11:cee25a834751 | 3 | * Copyright (C) 2006-2016 wolfSSL Inc. |
wolfSSL | 11:cee25a834751 | 4 | * |
wolfSSL | 11:cee25a834751 | 5 | * This file is part of wolfSSL. |
wolfSSL | 11:cee25a834751 | 6 | * |
wolfSSL | 11:cee25a834751 | 7 | * wolfSSL is free software; you can redistribute it and/or modify |
wolfSSL | 11:cee25a834751 | 8 | * it under the terms of the GNU General Public License as published by |
wolfSSL | 11:cee25a834751 | 9 | * the Free Software Foundation; either version 2 of the License, or |
wolfSSL | 11:cee25a834751 | 10 | * (at your option) any later version. |
wolfSSL | 11:cee25a834751 | 11 | * |
wolfSSL | 11:cee25a834751 | 12 | * wolfSSL is distributed in the hope that it will be useful, |
wolfSSL | 11:cee25a834751 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
wolfSSL | 11:cee25a834751 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wolfSSL | 11:cee25a834751 | 15 | * GNU General Public License for more details. |
wolfSSL | 11:cee25a834751 | 16 | * |
wolfSSL | 11:cee25a834751 | 17 | * You should have received a copy of the GNU General Public License |
wolfSSL | 11:cee25a834751 | 18 | * along with this program; if not, write to the Free Software |
wolfSSL | 11:cee25a834751 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
wolfSSL | 11:cee25a834751 | 20 | */ |
wolfSSL | 11:cee25a834751 | 21 | |
wolfSSL | 11:cee25a834751 | 22 | |
wolfSSL | 11:cee25a834751 | 23 | |
wolfSSL | 11:cee25a834751 | 24 | /* hmac.h defines mini hamc openssl compatibility layer |
wolfSSL | 11:cee25a834751 | 25 | * |
wolfSSL | 11:cee25a834751 | 26 | */ |
wolfSSL | 11:cee25a834751 | 27 | |
wolfSSL | 11:cee25a834751 | 28 | |
wolfSSL | 11:cee25a834751 | 29 | #ifndef WOLFSSL_HMAC_H_ |
wolfSSL | 11:cee25a834751 | 30 | #define WOLFSSL_HMAC_H_ |
wolfSSL | 11:cee25a834751 | 31 | |
wolfSSL | 11:cee25a834751 | 32 | #include <wolfssl/wolfcrypt/settings.h> |
wolfSSL | 11:cee25a834751 | 33 | |
wolfSSL | 11:cee25a834751 | 34 | #ifdef WOLFSSL_PREFIX |
wolfSSL | 11:cee25a834751 | 35 | #include "prefix_hmac.h" |
wolfSSL | 11:cee25a834751 | 36 | #endif |
wolfSSL | 11:cee25a834751 | 37 | |
wolfSSL | 11:cee25a834751 | 38 | #include <wolfssl/openssl/evp.h> |
wolfSSL | 11:cee25a834751 | 39 | #include <wolfssl/wolfcrypt/hmac.h> |
wolfSSL | 11:cee25a834751 | 40 | |
wolfSSL | 11:cee25a834751 | 41 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 42 | extern "C" { |
wolfSSL | 11:cee25a834751 | 43 | #endif |
wolfSSL | 11:cee25a834751 | 44 | |
wolfSSL | 11:cee25a834751 | 45 | |
wolfSSL | 11:cee25a834751 | 46 | WOLFSSL_API unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md, |
wolfSSL | 11:cee25a834751 | 47 | const void* key, int key_len, |
wolfSSL | 11:cee25a834751 | 48 | const unsigned char* d, int n, unsigned char* md, |
wolfSSL | 11:cee25a834751 | 49 | unsigned int* md_len); |
wolfSSL | 11:cee25a834751 | 50 | |
wolfSSL | 11:cee25a834751 | 51 | |
wolfSSL | 11:cee25a834751 | 52 | typedef struct WOLFSSL_HMAC_CTX { |
wolfSSL | 11:cee25a834751 | 53 | Hmac hmac; |
wolfSSL | 11:cee25a834751 | 54 | int type; |
wolfSSL | 11:cee25a834751 | 55 | } WOLFSSL_HMAC_CTX; |
wolfSSL | 11:cee25a834751 | 56 | |
wolfSSL | 11:cee25a834751 | 57 | |
wolfSSL | 11:cee25a834751 | 58 | WOLFSSL_API void wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key, |
wolfSSL | 11:cee25a834751 | 59 | int keylen, const EVP_MD* type); |
wolfSSL | 11:cee25a834751 | 60 | WOLFSSL_API int wolfSSL_HMAC_Init_ex(WOLFSSL_HMAC_CTX* ctx, const void* key, |
wolfSSL | 11:cee25a834751 | 61 | int len, const EVP_MD* md, void* impl); |
wolfSSL | 11:cee25a834751 | 62 | WOLFSSL_API void wolfSSL_HMAC_Update(WOLFSSL_HMAC_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 63 | const unsigned char* data, int len); |
wolfSSL | 11:cee25a834751 | 64 | WOLFSSL_API void wolfSSL_HMAC_Final(WOLFSSL_HMAC_CTX* ctx, unsigned char* hash, |
wolfSSL | 11:cee25a834751 | 65 | unsigned int* len); |
wolfSSL | 11:cee25a834751 | 66 | WOLFSSL_API void wolfSSL_HMAC_cleanup(WOLFSSL_HMAC_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 67 | |
wolfSSL | 11:cee25a834751 | 68 | |
wolfSSL | 11:cee25a834751 | 69 | typedef struct WOLFSSL_HMAC_CTX HMAC_CTX; |
wolfSSL | 11:cee25a834751 | 70 | |
wolfSSL | 11:cee25a834751 | 71 | #define HMAC(a,b,c,d,e,f,g) wolfSSL_HMAC((a),(b),(c),(d),(e),(f),(g)) |
wolfSSL | 11:cee25a834751 | 72 | |
wolfSSL | 11:cee25a834751 | 73 | #define HMAC_Init wolfSSL_HMAC_Init |
wolfSSL | 11:cee25a834751 | 74 | #define HMAC_Init_ex wolfSSL_HMAC_Init_ex |
wolfSSL | 11:cee25a834751 | 75 | #define HMAC_Update wolfSSL_HMAC_Update |
wolfSSL | 11:cee25a834751 | 76 | #define HMAC_Final wolfSSL_HMAC_Final |
wolfSSL | 11:cee25a834751 | 77 | #define HMAC_cleanup wolfSSL_HMAC_cleanup |
wolfSSL | 11:cee25a834751 | 78 | |
wolfSSL | 11:cee25a834751 | 79 | |
wolfSSL | 11:cee25a834751 | 80 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 81 | } /* extern "C" */ |
wolfSSL | 11:cee25a834751 | 82 | #endif |
wolfSSL | 11:cee25a834751 | 83 | |
wolfSSL | 11:cee25a834751 | 84 | |
wolfSSL | 11:cee25a834751 | 85 | #endif /* WOLFSSL_HMAC_H_ */ |
wolfSSL | 11:cee25a834751 | 86 |