From cfe058596fc8d281ab57da254719b2f311c1cc3e Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 4 Feb 2016 09:42:49 +0700 Subject: [PATCH] Include asmCrypto via npm --- .jshintrc | 1 - Gruntfile.js | 7 +------ package.json | 1 + src/crypto/hash/index.js | 3 ++- src/crypto/index.js | 3 --- src/packet/sym_encrypted_integrity_protected.js | 1 + 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.jshintrc b/.jshintrc index aa08bea0..048a1b12 100644 --- a/.jshintrc +++ b/.jshintrc @@ -31,7 +31,6 @@ "afterEach": true, "escape": true, "unescape": true, - "asmCrypto": true, "postMessage": true } } \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 414e2e63..ffe6ff19 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,12 +14,7 @@ module.exports = function(grunt) { 'src/crypto/public_key/elgamal.js', 'src/crypto/public_key/index.js', 'src/crypto/public_key/rsa.js', - 'src/crypto/cfb.js', - 'src/crypto/crypto.js', - 'src/crypto/index.js', - 'src/crypto/pkcs1.js', - 'src/crypto/random.js', - 'src/crypto/signature.js', + 'src/crypto/*.js', 'src/encoding/*.js', 'src/hkp/*.js', 'src/keyring/*.js', diff --git a/package.json b/package.json index 5166d8f1..30879667 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "whatwg-fetch": "~0.11.0" }, "dependencies": { + "asmcrypto": "git://github.com/openpgpjs/asmcrypto.js.git#openpgp_build", "es6-promise": "^1.0.0", "node-fetch": "^1.3.3", "node-localstorage": "~1.1.2", diff --git a/src/crypto/hash/index.js b/src/crypto/hash/index.js index 295d536b..a80f5b22 100644 --- a/src/crypto/hash/index.js +++ b/src/crypto/hash/index.js @@ -6,8 +6,9 @@ * @module crypto/hash */ var sha = require('./sha.js'), + asmCrypto = require('asmcrypto'), rusha = require('./rusha.js'), - config = require('../../config') + config = require('../../config'), util = require('../../util.js'); var rusha_obj = new rusha(); diff --git a/src/crypto/index.js b/src/crypto/index.js index 5b094871..57411108 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -5,9 +5,6 @@ 'use strict'; -// asmCrypto global object (AES CFB, SHA1, SHA256, SHA512) -require('./asmcrypto.js'); - module.exports = { /** @see module:crypto/cipher */ cipher: require('./cipher'), diff --git a/src/packet/sym_encrypted_integrity_protected.js b/src/packet/sym_encrypted_integrity_protected.js index db803423..ac14e6a9 100644 --- a/src/packet/sym_encrypted_integrity_protected.js +++ b/src/packet/sym_encrypted_integrity_protected.js @@ -39,6 +39,7 @@ module.exports = SymEncryptedIntegrityProtected; var util = require('../util.js'), crypto = require('../crypto'), enums = require('../enums.js'), + asmCrypto = require('asmcrypto'), nodeCrypto = util.getNodeCrypto(), Buffer = util.getNodeBuffer();