diff --git a/src/crypto/cipher/aes.js b/src/crypto/cipher/aes.js index 5303f2aa..2bf153d8 100644 --- a/src/crypto/cipher/aes.js +++ b/src/crypto/cipher/aes.js @@ -511,4 +511,4 @@ export default { 128: makeClass(128), 192: makeClass(192), 256: makeClass(256) -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/crypto/cipher/blowfish.js b/src/crypto/cipher/blowfish.js index dc7e5cdc..e910b050 100644 --- a/src/crypto/cipher/blowfish.js +++ b/src/crypto/cipher/blowfish.js @@ -395,7 +395,7 @@ Blowfish.prototype.init = function(key) { // added by Recurity Labs -function BF(key) { +export default function BF(key) { this.bf = new Blowfish(); this.bf.init(key); @@ -403,8 +403,5 @@ function BF(key) { return this.bf.encrypt_block(block); }; } - - -module.exports = BF; -module.exports.keySize = BF.prototype.keySize = 16; -module.exports.blockSize = BF.prototype.blockSize = 16; +BF.keySize = BF.prototype.keySize = 16; +BF.blockSize = BF.prototype.blockSize = 16; \ No newline at end of file diff --git a/src/crypto/cipher/cast5.js b/src/crypto/cipher/cast5.js index 5d656b57..cf2ef6f1 100644 --- a/src/crypto/cipher/cast5.js +++ b/src/crypto/cipher/cast5.js @@ -592,7 +592,7 @@ function OpenpgpSymencCast5() { } -function Cast5(key) { +export default function Cast5(key) { this.cast5 = new OpenpgpSymencCast5(); this.cast5.setKey(key); @@ -601,6 +601,5 @@ function Cast5(key) { }; } -module.exports = Cast5; -module.exports.blockSize = Cast5.prototype.blockSize = 8; -module.exports.keySize = Cast5.prototype.keySize = 16; +Cast5.blockSize = Cast5.prototype.blockSize = 8; +Cast5.keySize = Cast5.prototype.keySize = 16; \ No newline at end of file diff --git a/src/crypto/cipher/des.js b/src/crypto/cipher/des.js index 4850a486..81c72a04 100644 --- a/src/crypto/cipher/des.js +++ b/src/crypto/cipher/des.js @@ -422,9 +422,9 @@ function OriginalDes(key) { }; } -module.exports = { +export default { /** @static */ des: Des, /** @static */ originalDes: OriginalDes -}; +}; \ No newline at end of file diff --git a/src/crypto/cipher/index.js b/src/crypto/cipher/index.js index 1400695b..04bb6ebc 100644 --- a/src/crypto/cipher/index.js +++ b/src/crypto/cipher/index.js @@ -8,8 +8,11 @@ 'use strict'; -import desModule from './des.js'; import aes from'./aes.js'; +import desModule from './des.js'; +import cast5 from './cast5.js'; +import twofish from './twofish.js'; +import blowfish from './blowfish.js'; module.exports = { /** @see module:crypto/cipher/aes */ @@ -21,11 +24,11 @@ module.exports = { /** @see module:crypto/cipher/des.des */ tripledes: desModule.des, /** @see module:crypto/cipher/cast5 */ - cast5: require('./cast5.js'), + cast5: cast5, /** @see module:crypto/cipher/twofish */ - twofish: require('./twofish.js'), + twofish: twofish, /** @see module:crypto/cipher/blowfish */ - blowfish: require('./blowfish.js'), + blowfish: blowfish, /** Not implemented */ idea: function() { throw new Error('IDEA symmetric-key algorithm not implemented'); diff --git a/src/crypto/cipher/twofish.js b/src/crypto/cipher/twofish.js index c7d6e90d..95b54614 100644 --- a/src/crypto/cipher/twofish.js +++ b/src/crypto/cipher/twofish.js @@ -329,7 +329,7 @@ function createTwofish() { // added by Recurity Labs -function TF(key) { +export default function TF(key) { this.tf = createTwofish(); this.tf.open(toArray(key), 0); @@ -347,7 +347,5 @@ function toArray(typedArray) { return result; } - -module.exports = TF; -module.exports.keySize = TF.prototype.keySize = 32; -module.exports.blockSize = TF.prototype.blockSize = 16; +TF.keySize = TF.prototype.keySize = 32; +TF.blockSize = TF.prototype.blockSize = 16; \ No newline at end of file