From 25fdad62e84a4d1c61a52d5b96dc5325982a30de Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 3 May 2013 20:06:03 +0200 Subject: fix partial byte output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- java-c-jni/SHA3.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'java-c-jni') diff --git a/java-c-jni/SHA3.c b/java-c-jni/SHA3.c index 9124743..827458a 100644 --- a/java-c-jni/SHA3.c +++ b/java-c-jni/SHA3.c @@ -680,6 +680,9 @@ byte* digest(byte* msg, jint msglen) if (olen > 0) keccakF(S); } + if ((n & 7)) + rc[n >> 3] &= (1 << (n & 7)) - 1; + return rc; } -- cgit v1.2.3-70-g09d2