Remove unused variables

This commit is contained in:
Daniel Huigens 2018-05-01 17:35:06 +02:00
parent 6e27e3145c
commit 4afaae13ca
14 changed files with 4 additions and 28 deletions

View File

@ -331,7 +331,7 @@ module.exports = {
// Custom warnings: // Custom warnings:
"no-console": 0, "no-console": 0,
"no-unused-vars": 0, "no-unused-vars": 1,
"indent": [ 0, 2, { "SwitchCase": 1 } ], "indent": [ 0, 2, { "SwitchCase": 1 } ],
// TODO Consider fixing these: // TODO Consider fixing these:

View File

@ -16,7 +16,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
/** /**
* @requires config
* @requires encoding/armor * @requires encoding/armor
* @requires enums * @requires enums
* @requires util * @requires util
@ -25,7 +24,6 @@
* @module cleartext * @module cleartext
*/ */
import config from './config';
import armor from './encoding/armor'; import armor from './encoding/armor';
import enums from './enums'; import enums from './enums';
import util from './util'; import util from './util';

View File

@ -53,12 +53,9 @@ function createTwofish() {
let dataBytes = null; let dataBytes = null;
let dataOffset = -1; let dataOffset = -1;
// var dataLength = -1; // var dataLength = -1;
let algorithmName = null;
// var idx2 = -1; // var idx2 = -1;
// //
algorithmName = "twofish";
let tfsKey = []; let tfsKey = [];
let tfsM = [ let tfsM = [
[], [],

View File

@ -28,7 +28,6 @@
* @requires type/mpi * @requires type/mpi
* @requires type/oid * @requires type/oid
* @requires enums * @requires enums
* @requires util
* @module crypto/crypto * @module crypto/crypto
*/ */
@ -40,7 +39,6 @@ import type_kdf_params from '../type/kdf_params';
import type_mpi from '../type/mpi'; import type_mpi from '../type/mpi';
import type_oid from '../type/oid'; import type_oid from '../type/oid';
import enums from '../enums'; import enums from '../enums';
import util from '../util';
function constructParams(types, data) { function constructParams(types, data) {
return types.map(function(type, i) { return types.map(function(type, i) {

View File

@ -19,13 +19,11 @@
* @fileoverview This module wraps native AES-GCM en/decryption for both * @fileoverview This module wraps native AES-GCM en/decryption for both
* the WebCrypto api as well as node.js' crypto api. * the WebCrypto api as well as node.js' crypto api.
* @requires asmcrypto.js * @requires asmcrypto.js
* @requires config
* @requires util * @requires util
* @module crypto/gcm * @module crypto/gcm
*/ */
import { AES_GCM } from 'asmcrypto.js/src/aes/gcm/exports'; import { AES_GCM } from 'asmcrypto.js/src/aes/gcm/exports';
import config from '../config';
import util from '../util'; import util from '../util';
const webCrypto = util.getWebCrypto(); // no GCM support in IE11, Safari 9 const webCrypto = util.getWebCrypto(); // no GCM support in IE11, Safari 9

View File

@ -20,7 +20,6 @@
* @requires bn.js * @requires bn.js
* @requires crypto/hash * @requires crypto/hash
* @requires crypto/random * @requires crypto/random
* @requires config
* @requires util * @requires util
* @module crypto/public_key/dsa * @module crypto/public_key/dsa
*/ */
@ -28,7 +27,6 @@
import BN from 'bn.js'; import BN from 'bn.js';
import hash from '../hash'; import hash from '../hash';
import random from '../random'; import random from '../random';
import config from '../../config';
import util from '../../util'; import util from '../../util';
const one = new BN(1); const one = new BN(1);

View File

@ -21,7 +21,6 @@
* @requires crypto/aes_kw * @requires crypto/aes_kw
* @requires crypto/cipher * @requires crypto/cipher
* @requires crypto/hash * @requires crypto/hash
* @requires type/oid
* @requires type/kdf_params * @requires type/kdf_params
* @requires enums * @requires enums
* @requires util * @requires util
@ -34,7 +33,6 @@ import aes_kw from '../../aes_kw';
import cipher from '../../cipher'; import cipher from '../../cipher';
import hash from '../../hash'; import hash from '../../hash';
import type_kdf_params from '../../../type/kdf_params'; import type_kdf_params from '../../../type/kdf_params';
import type_oid from '../../../type/oid';
import enums from '../../../enums'; import enums from '../../../enums';
import util from '../../../util'; import util from '../../../util';

View File

@ -17,12 +17,10 @@
/** /**
* @fileoverview Implementation of ECDSA following RFC6637 for Openpgpjs * @fileoverview Implementation of ECDSA following RFC6637 for Openpgpjs
* @requires crypto/hash
* @requires crypto/public_key/elliptic/curve * @requires crypto/public_key/elliptic/curve
* @module crypto/public_key/elliptic/ecdsa * @module crypto/public_key/elliptic/ecdsa
*/ */
import hash from '../../hash';
import Curve from './curves'; import Curve from './curves';
/** /**

View File

@ -17,14 +17,10 @@
/** /**
* @fileoverview Implementation of EdDSA following RFC4880bis-03 for OpenPGP * @fileoverview Implementation of EdDSA following RFC4880bis-03 for OpenPGP
* @requires bn.js
* @requires crypto/hash
* @requires crypto/public_key/elliptic/curve * @requires crypto/public_key/elliptic/curve
* @module crypto/public_key/elliptic/eddsa * @module crypto/public_key/elliptic/eddsa
*/ */
import BN from 'bn.js';
import hash from '../../hash';
import Curve from './curves'; import Curve from './curves';
/** /**

View File

@ -18,7 +18,7 @@
/** /**
* @fileoverview Wrapper for a KeyPair of an Elliptic Curve * @fileoverview Wrapper for a KeyPair of an Elliptic Curve
* @requires bn.js * @requires bn.js
* @requires crypto/public_key/elliptic/curve * @requires crypto/public_key/elliptic/curves
* @requires crypto/hash * @requires crypto/hash
* @requires util * @requires util
* @requires enums * @requires enums
@ -27,7 +27,7 @@
*/ */
import BN from 'bn.js'; import BN from 'bn.js';
import { webCurves, nodeCurves } from './curves'; import { webCurves } from './curves';
import hash from '../../hash'; import hash from '../../hash';
import util from '../../../util'; import util from '../../../util';
import enums from '../../../enums'; import enums from '../../../enums';

View File

@ -20,13 +20,11 @@
/** /**
* @fileoverview Provides tools for retrieving secure randomness from browsers or Node.js * @fileoverview Provides tools for retrieving secure randomness from browsers or Node.js
* @requires bn.js * @requires bn.js
* @requires type/mpi
* @requires util * @requires util
* @module crypto/random * @module crypto/random
*/ */
import BN from 'bn.js'; import BN from 'bn.js';
import type_mpi from '../type/mpi';
import util from '../util'; import util from '../util';
// Do not use util.getNodeCrypto because we need this regardless of use_native setting // Do not use util.getNodeCrypto because we need this regardless of use_native setting

View File

@ -126,7 +126,6 @@ export default Compressed;
const nodeZlib = util.getNodeZlib(); const nodeZlib = util.getNodeZlib();
const Buffer = util.getNodeBuffer();
function node_zlib(func, options = {}) { function node_zlib(func, options = {}) {
return function (data) { return function (data) {

View File

@ -16,7 +16,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
/** /**
* @requires type/ecdh_symkey
* @requires type/keyid * @requires type/keyid
* @requires type/mpi * @requires type/mpi
* @requires crypto * @requires crypto
@ -24,7 +23,6 @@
* @requires util * @requires util
*/ */
import type_ecdh_symkey from '../type/ecdh_symkey';
import type_keyid from '../type/keyid'; import type_keyid from '../type/keyid';
import type_mpi from '../type/mpi'; import type_mpi from '../type/mpi';
import crypto from '../crypto'; import crypto from '../crypto';

View File

@ -46,7 +46,7 @@ function randomCallback() {
self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER }); self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER });
} }
return new Promise(function(resolve, reject) { return new Promise(function(resolve) {
randomQueue.push(resolve); randomQueue.push(resolve);
}); });
} }