From 96064258ea02be970f1f95093cea4ee877f6dffe Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 14 Feb 2013 20:58:51 +0100 Subject: unsigned shift fix (cannot read from stdin) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- vala/sha3sum.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vala/sha3sum.vala') diff --git a/vala/sha3sum.vala b/vala/sha3sum.vala index e34c47b..5e0b792 100644 --- a/vala/sha3sum.vala +++ b/vala/sha3sum.vala @@ -159,7 +159,7 @@ class SHA3 : Object private int64 rotate(int64 x, int n) { int64 m = n % this.w; - return (((x >> (this.w - m)) & ((1 << m) - 1)) + (x << m)) & this.wmod; + return ((int64)((uint64)x >> (this.w - m)) + (x << m)) & this.wmod; } @@ -172,7 +172,7 @@ class SHA3 : Object */ private int64 rotate64(int64 x, int n) { - return ((x >> (64 - n)) & ((1 << n) - 1)) + (x << n); + return (int64)((uint64)x >> (64 - n)) + (x << n); } -- cgit v1.2.3-70-g09d2