Fixed incorrect result when first bit is 1 of bytes.

This commit is contained in:
Yi-Cyuan Chen
2017-12-21 20:52:13 +08:00
parent 6aed3e39c4
commit 241405d4fd
11 changed files with 1646 additions and 165 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* [js-sha512]{@link https://github.com/emn178/js-sha512}
*
* @version 0.7.0
* @version 0.7.1
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
@@ -324,7 +324,7 @@
blocks[25] = blocks[26] = blocks[27] = blocks[28] =
blocks[29] = blocks[30] = blocks[31] = blocks[32] = 0;
}
blocks[30] = this.hBytes << 3 | this.bytes >> 29;
blocks[30] = this.hBytes << 3 | this.bytes >>> 29;
blocks[31] = this.bytes << 3;
this.hash();
};