aboutsummaryrefslogtreecommitdiff
path: root/gost_grasshopper_math.h
diff options
context:
space:
mode:
authorDmitry Ryazantsev <dimitriy.ryazantcev@gmail.com>2018-01-09 16:04:55 +0200
committerDmitry Ryazantsev <dimitriy.ryazantcev@gmail.com>2018-01-10 15:27:25 +0200
commit9d0a4584f65d09d396e2dd655f7ae390ac64d60e (patch)
tree4d581f6a7c8a106073f4c411c58f8326f4de7882 /gost_grasshopper_math.h
parent2c5c85adf6abc27fd5894c0a82587bc6fbdfb170 (diff)
downloadgost-engine-9d0a4584f65d09d396e2dd655f7ae390ac64d60e.zip
gost-engine-9d0a4584f65d09d396e2dd655f7ae390ac64d60e.tar.gz
gost-engine-9d0a4584f65d09d396e2dd655f7ae390ac64d60e.tar.bz2
Fix MSVS2017 build errors.
Also add missing getopt.h header for gostsum and gost12sum tools build in MSVS (borrowed from https://github.com/skandhurkat/Getopt-for-Visual-Studio).
Diffstat (limited to 'gost_grasshopper_math.h')
-rw-r--r--gost_grasshopper_math.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gost_grasshopper_math.h b/gost_grasshopper_math.h
index 176d16a..43341a8 100644
--- a/gost_grasshopper_math.h
+++ b/gost_grasshopper_math.h
@@ -119,7 +119,7 @@ extern uint8_t grasshopper_galois_alpha_to[256];
extern uint8_t grasshopper_galois_index_of[256];
static GRASSHOPPER_INLINE uint8_t grasshopper_galois_mul(uint8_t x, uint8_t y) {
- if (__builtin_expect(x != 0 && y != 0, 1)) {
+ if (likely(x != 0 && y != 0)) {
return grasshopper_galois_alpha_to[(grasshopper_galois_index_of[x] + grasshopper_galois_index_of[y]) %
GRASSHOPPER_GALOIS_FIELD_SIZE];
} else {