@@ -604,15 +604,14 @@ static __constant ulong32 K[64] = {
604
604
};
605
605
#endif
606
606
607
- /* Various logical functions */
608
607
#define Ch (x ,y ,z ) (z ^ (x & (y ^ z)))
609
608
#define Maj (x ,y ,z ) (((x | y) & z) | (x & y))
610
- #define S (x , n ) ROR64c ((x),(n))
611
- #define R (x , n ) (((((ulong)x) & ((ulong)0xFFFFFFFFFFFFFFFFUL))) >> ((ulong) n))
612
- #define Sigma0 (x ) (S(x, 28 ) ^ S(x, 34 ) ^ S(x, 39 ))
613
- #define Sigma1 (x ) (S(x, 14 ) ^ S(x, 18 ) ^ S(x, 41 ))
614
- #define Gamma0 (x ) (S(x, 1 ) ^ S(x, 8 ) ^ R(x, 7 ))
615
- #define Gamma1 (x ) (S(x, 19 ) ^ S(x, 61 ) ^ R(x, 6 ))
609
+ #define S (x , n ) RORc ((x),(n))
610
+ #define R (x , n ) (((x)&0xFFFFFFFFUL)>>( n))
611
+ #define Sigma0 (x ) (S(x, 2 ) ^ S(x, 13 ) ^ S(x, 22 ))
612
+ #define Sigma1 (x ) (S(x, 6 ) ^ S(x, 11 ) ^ S(x, 25 ))
613
+ #define Gamma0 (x ) (S(x, 7 ) ^ S(x, 18 ) ^ R(x, 3 ))
614
+ #define Gamma1 (x ) (S(x, 17 ) ^ S(x, 19 ) ^ R(x, 10 ))
616
615
#ifndef MIN
617
616
#define MIN (x , y ) ( ((x)<(y))?(x):(y) )
618
617
#endif
@@ -642,7 +641,7 @@ static int sha256_compress(hash_state * md, const unsigned char *buf)
642
641
643
642
/* fill W[16..63] */
644
643
for (i = 16 ; i < 64 ; i ++ ) {
645
- W [i ] + = Gamma1 (W [i - 2 ]) + W [i - 7 ] + Gamma0 (W [i - 15 ]) + W [i - 16 ];
644
+ W [i ] = Gamma1 (W [i - 2 ]) + W [i - 7 ] + Gamma0 (W [i - 15 ]) + W [i - 16 ];
646
645
}
647
646
648
647
/* Compress */
@@ -738,6 +737,7 @@ static int sha256_compress(hash_state * md, const unsigned char *buf)
738
737
for (i = 0 ; i < 8 ; i ++ ) {
739
738
md -> sha256 .state [i ] = md -> sha256 .state [i ] + S [i ];
740
739
}
740
+
741
741
return CRYPT_OK ;
742
742
}
743
743
@@ -4266,7 +4266,6 @@ __kernel void poh_verify_kernel(__global uint8_t* hashes,
4266
4266
for (int i = 0 ; i < SHA256_BLOCK_SIZE ; i ++ ) {
4267
4267
hash [i ] = hashes [idx * SHA256_BLOCK_SIZE + i ];
4268
4268
}
4269
-
4270
4269
4271
4270
for (size_t i = 0 ; i < num_hashes_arr [idx ]; i ++ ) {
4272
4271
hash_state sha_state ;
0 commit comments