Update wolfSSL to the latest version(v.4.4.0) (#186)

* deleted old version wolfSSL before updating

* updated wolfSSL to the latest version(v4.4.0)

* updated wolfSSL to the latest version(v4.4.0)

* added macros for timing resistance

Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
Co-authored-by: Ming Yue <mingyue86010@gmail.com>
This commit is contained in:
TakayukiMatsuo 2020-08-08 07:58:14 +09:00 committed by GitHub
parent 68518f5866
commit 94aa31c3cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1185 changed files with 837519 additions and 72138 deletions

View file

@ -12,9 +12,9 @@
*/
/* blake2-impl.h
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,16 +28,17 @@
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLFCRYPT_BLAKE2_IMPL_H
#define WOLFCRYPT_BLAKE2_IMPL_H
#include <wolfssl/wolfcrypt/types.h>
static inline word32 load32( const void *src )
static WC_INLINE word32 load32( const void *src )
{
#if defined(LITTLE_ENDIAN_ORDER)
return *( word32 * )( src );
@ -51,7 +52,7 @@ static inline word32 load32( const void *src )
#endif
}
static inline word64 load64( const void *src )
static WC_INLINE word64 load64( const void *src )
{
#if defined(LITTLE_ENDIAN_ORDER)
return *( word64 * )( src );
@ -69,7 +70,7 @@ static inline word64 load64( const void *src )
#endif
}
static inline void store32( void *dst, word32 w )
static WC_INLINE void store32( void *dst, word32 w )
{
#if defined(LITTLE_ENDIAN_ORDER)
*( word32 * )( dst ) = w;
@ -82,7 +83,7 @@ static inline void store32( void *dst, word32 w )
#endif
}
static inline void store64( void *dst, word64 w )
static WC_INLINE void store64( void *dst, word64 w )
{
#if defined(LITTLE_ENDIAN_ORDER)
*( word64 * )( dst ) = w;
@ -99,7 +100,7 @@ static inline void store64( void *dst, word64 w )
#endif
}
static inline word64 load48( const void *src )
static WC_INLINE word64 load48( const void *src )
{
const byte *p = ( const byte * )src;
word64 w = *p++;
@ -111,7 +112,7 @@ static inline word64 load48( const void *src )
return w;
}
static inline void store48( void *dst, word64 w )
static WC_INLINE void store48( void *dst, word64 w )
{
byte *p = ( byte * )dst;
*p++ = ( byte )w; w >>= 8;
@ -122,28 +123,28 @@ static inline void store48( void *dst, word64 w )
*p++ = ( byte )w;
}
static inline word32 rotl32( const word32 w, const unsigned c )
static WC_INLINE word32 rotl32( const word32 w, const unsigned c )
{
return ( w << c ) | ( w >> ( 32 - c ) );
}
static inline word64 rotl64( const word64 w, const unsigned c )
static WC_INLINE word64 rotl64( const word64 w, const unsigned c )
{
return ( w << c ) | ( w >> ( 64 - c ) );
}
static inline word32 rotr32( const word32 w, const unsigned c )
static WC_INLINE word32 rotr32( const word32 w, const unsigned c )
{
return ( w >> c ) | ( w << ( 32 - c ) );
}
static inline word64 rotr64( const word64 w, const unsigned c )
static WC_INLINE word64 rotr64( const word64 w, const unsigned c )
{
return ( w >> c ) | ( w << ( 64 - c ) );
}
/* prevents compiler optimizing out memset() */
static inline void secure_zero_memory( void *v, word64 n )
static WC_INLINE void secure_zero_memory( void *v, word64 n )
{
volatile byte *p = ( volatile byte * )v;