Switches to asmcrypto-lite for AES

This commit is contained in:
Mahrud Sayrafi 2018-01-30 05:15:03 -08:00 committed by Sanjana Rajan
parent be2c605e5b
commit aba8a7a647
5 changed files with 14 additions and 1125 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,9 @@ import blowfish from './blowfish.js';
export default {
/** @see module:crypto/cipher/aes */
aes128: aes[128],
aes192: aes[192],
aes256: aes[256],
aes128: aes(128),
aes192: aes(192),
aes256: aes(256),
/** @see module:crypto/cipher/des.originalDes */
des: desModule.originalDes,
/** @see module:crypto/cipher/des.des */

View File

@ -55,6 +55,7 @@ if(nodeCrypto) { // Use Node native crypto for all hash functions
sha256: asmCrypto.SHA256.bytes,
/** @see module:crypto/hash/sha.sha384 */
sha384: sha.sha384,
// TODO: compare sha512 in asmcrypto.js and jsSHA
/** @see module:crypto/hash/sha.sha512 */
sha512: sha.sha512,
/** @see module:crypto/hash/ripe-md */

View File

@ -1594,7 +1594,6 @@ export default {
sha384: function(str) {
var shaObj = new jsSHA(str, "TYPED", "UTF8");
return shaObj.getHash("SHA-384", "TYPED");
},
/** SHA512 hash */
sha512: function(str) {

View File

@ -270,6 +270,7 @@ describe('X25519 Cryptography', function () {
var msg = openpgp.cleartext.readArmored(signed.data);
// Verifying signed message
return Promise.all([
// FIXME this test sporadically fails
openpgp.verify(
{ message: msg, publicKeys: hi.toPublic() }
).then(output => expect(output.signatures[0].valid).to.be.true),