- Timestamp:
- Feb 7, 2019, 8:36:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/sha.h
r352 r372 20 20 */ 21 21 22 /*! 23 \file wolfssl/wolfcrypt/sha.h 24 */ 25 22 26 23 27 #ifndef WOLF_CRYPT_SHA_H … … 28 32 #ifndef NO_SHA 29 33 30 #ifdef HAVE_FIPS 34 #if defined(HAVE_FIPS) && \ 35 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) 36 #include <wolfssl/wolfcrypt/fips.h> 37 #endif /* HAVE_FIPS_VERSION >= 2 */ 38 39 #if defined(HAVE_FIPS) && \ 40 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)) 31 41 #define wc_Sha Sha 32 42 #define WC_SHA SHA … … 47 57 #endif 48 58 49 #ifndef HAVE_FIPS /* avoid redefining structs */ 59 /* avoid redefinition of structs */ 60 #if !defined(HAVE_FIPS) || \ 61 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)) 50 62 51 63 #ifdef WOLFSSL_MICROCHIP_PIC32MZ 52 64 #include <wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h> 65 #endif 66 #ifdef STM32_HASH 67 #include <wolfssl/wolfcrypt/port/st/stm32.h> 53 68 #endif 54 69 #ifdef WOLFSSL_ASYNC_CRYPT … … 56 71 #endif 57 72 73 #if !defined(NO_OLD_SHA_NAMES) 74 #define SHA WC_SHA 75 #endif 76 58 77 #ifndef NO_OLD_WC_NAMES 59 78 #define Sha wc_Sha 60 #define SHA WC_SHA61 79 #define SHA_BLOCK_SIZE WC_SHA_BLOCK_SIZE 62 80 #define SHA_DIGEST_SIZE WC_SHA_DIGEST_SIZE … … 66 84 /* in bytes */ 67 85 enum { 68 WC_SHA = 1, /* hash type unique */86 WC_SHA = WC_HASH_TYPE_SHA, 69 87 WC_SHA_BLOCK_SIZE = 64, 70 88 WC_SHA_DIGEST_SIZE = 20, … … 73 91 74 92 75 #ifndef WOLFSSL_TI_HASH 93 #if defined(WOLFSSL_TI_HASH) 94 #include "wolfssl/wolfcrypt/port/ti/ti-hash.h" 95 96 #elif defined(WOLFSSL_IMX6_CAAM) 97 #include "wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h" 98 99 #else 76 100 /* Sha digest */ 77 101 typedef struct wc_Sha { 78 102 #ifdef FREESCALE_LTC_SHA 79 103 ltc_hash_ctx_t ctx; 104 #elif defined(STM32_HASH) 105 STM32_HASH_Context stmCtx; 80 106 #else 81 107 word32 buffLen; /* in bytes */ … … 95 121 WC_ASYNC_DEV asyncDev; 96 122 #endif /* WOLFSSL_ASYNC_CRYPT */ 97 #endif /* FREESCALE_LTC_SHA */123 #endif 98 124 } wc_Sha; 99 125 100 #else101 #include "wolfssl/wolfcrypt/port/ti/ti-hash.h"102 126 #endif /* WOLFSSL_TI_HASH */ 103 127 … … 108 132 WOLFSSL_API int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId); 109 133 WOLFSSL_API int wc_ShaUpdate(wc_Sha*, const byte*, word32); 134 WOLFSSL_API int wc_ShaFinalRaw(wc_Sha*, byte*); 110 135 WOLFSSL_API int wc_ShaFinal(wc_Sha*, byte*); 111 136 WOLFSSL_API void wc_ShaFree(wc_Sha*);
Note:
See TracChangeset
for help on using the changeset viewer.