/* sha256.h
*
- * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ * Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
*
*
* 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 {
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