Merge pull request #4415 from elms/ppc/define_gates_64bit_literals

Define gate fixes and sha3 64bit literal definitions
This commit is contained in:
John Safranek
2021-09-23 10:18:03 -07:00
committed by GitHub
2 changed files with 14 additions and 13 deletions

View File

@ -275,21 +275,22 @@ static void BlockSha3(word64 *s)
*/ */
#define ROTL64(a, n) (((a)<<(n))|((a)>>(64-(n)))) #define ROTL64(a, n) (((a)<<(n))|((a)>>(64-(n))))
/* An array of values to XOR for block operation. */ /* An array of values to XOR for block operation. */
static const word64 hash_keccak_r[24] = static const word64 hash_keccak_r[24] =
{ {
0x0000000000000001UL, 0x0000000000008082UL, W64LIT(0x0000000000000001), W64LIT(0x0000000000008082),
0x800000000000808aUL, 0x8000000080008000UL, W64LIT(0x800000000000808a), W64LIT(0x8000000080008000),
0x000000000000808bUL, 0x0000000080000001UL, W64LIT(0x000000000000808b), W64LIT(0x0000000080000001),
0x8000000080008081UL, 0x8000000000008009UL, W64LIT(0x8000000080008081), W64LIT(0x8000000000008009),
0x000000000000008aUL, 0x0000000000000088UL, W64LIT(0x000000000000008a), W64LIT(0x0000000000000088),
0x0000000080008009UL, 0x000000008000000aUL, W64LIT(0x0000000080008009), W64LIT(0x000000008000000a),
0x000000008000808bUL, 0x800000000000008bUL, W64LIT(0x000000008000808b), W64LIT(0x800000000000008b),
0x8000000000008089UL, 0x8000000000008003UL, W64LIT(0x8000000000008089), W64LIT(0x8000000000008003),
0x8000000000008002UL, 0x8000000000000080UL, W64LIT(0x8000000000008002), W64LIT(0x8000000000000080),
0x000000000000800aUL, 0x800000008000000aUL, W64LIT(0x000000000000800a), W64LIT(0x800000008000000a),
0x8000000080008081UL, 0x8000000000008080UL, W64LIT(0x8000000080008081), W64LIT(0x8000000000008080),
0x0000000080000001UL, 0x8000000080008008UL W64LIT(0x0000000080000001), W64LIT(0x8000000080008008)
}; };
/* Indices used in swap and rotate operation. */ /* Indices used in swap and rotate operation. */

View File

@ -2469,7 +2469,7 @@ time_t time(time_t * timer)
#endif /* !NO_ASN_TIME */ #endif /* !NO_ASN_TIME */
#ifndef WOLFSSL_LEANPSK #if !defined(WOLFSSL_LEANPSK) && !defined(STRING_USER)
char* mystrnstr(const char* s1, const char* s2, unsigned int n) char* mystrnstr(const char* s1, const char* s2, unsigned int n)
{ {
unsigned int s2_len = (unsigned int)XSTRLEN(s2); unsigned int s2_len = (unsigned int)XSTRLEN(s2);