]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha256.h
Update CyaSSL to latest version.
[freertos] / FreeRTOS-Plus / Source / CyaSSL / cyassl / ctaocrypt / sha256.h
index 179a78031f563396c49d53944212086f4171ba4b..c619461a31e227916ccd8b4f04576f312daceb20 100644 (file)
@@ -1,6 +1,6 @@
 /* sha256.h
  *
- * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ * Copyright (C) 2006-2014 wolfSSL Inc.
  *
  * This file is part of CyaSSL.
  *
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
 
     extern "C" {
 #endif
 
+#ifdef CYASSL_PIC32MZ_HASH
+#include "port/pic32/pic32mz-crypt.h"
+#endif
+
 
 /* in bytes */
 enum {
@@ -51,14 +55,33 @@ typedef struct Sha256 {
     word32  hiLen;     /* length in bytes   */
     word32  digest[SHA256_DIGEST_SIZE / sizeof(word32)];
     word32  buffer[SHA256_BLOCK_SIZE  / sizeof(word32)];
+    #ifdef CYASSL_PIC32MZ_HASH
+        pic32mz_desc desc ; /* Crypt Engine descripter */
+    #endif
 } Sha256;
 
 
-CYASSL_API void InitSha256(Sha256*);
-CYASSL_API void Sha256Update(Sha256*, const byte*, word32);
-CYASSL_API void Sha256Final(Sha256*, byte*);
+CYASSL_API int InitSha256(Sha256*);
+CYASSL_API int Sha256Update(Sha256*, const byte*, word32);
+CYASSL_API int Sha256Final(Sha256*, byte*);
+CYASSL_API int Sha256Hash(const byte*, word32, byte*);
+
+
+#ifdef HAVE_FIPS
+    /* fips wrapper calls, user can call direct */
+    CYASSL_API int InitSha256_fips(Sha256*);
+    CYASSL_API int Sha256Update_fips(Sha256*, const byte*, word32);
+    CYASSL_API int Sha256Final_fips(Sha256*, byte*);
+    #ifndef FIPS_NO_WRAPPERS
+        /* if not impl or fips.c impl wrapper force fips calls if fips build */
+        #define InitSha256   InitSha256_fips
+        #define Sha256Update Sha256Update_fips
+        #define Sha256Final  Sha256Final_fips
+    #endif /* FIPS_NO_WRAPPERS */
 
+#endif /* HAVE_FIPS */
 
 #ifdef __cplusplus
     } /* extern "C" */
 #endif