Skip to content

Commit

Permalink
chore: rename BF to Blowfish
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanscut committed Sep 16, 2021
1 parent fb81418 commit 762feb2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion grunt/config/modularize.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports = {
"components": ["core", "enc-base64", "md5", "evpkdf", "cipher-core", "aes"]
},
"blowfish": {
"exports": "CryptoJS.BF",
"exports": "CryptoJS.Blowfish",
"components": ["core", "enc-base64", "md5", "evpkdf", "cipher-core", "blowfish"]
},
"tripledes": {
Expand Down
10 changes: 5 additions & 5 deletions src/blowfish.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@
}

/**
* BF block cipher algorithm.
* Blowfish block cipher algorithm.
*/
var BF = C_algo.BF = BlockCipher.extend({
var Blowfish = C_algo.Blowfish = BlockCipher.extend({
_doReset: function () {
// Skip reset of nRounds has been set before and key did not change
if (this._keyPriorReset === this._key) {
Expand Down Expand Up @@ -444,8 +444,8 @@
*
* @example
*
* var ciphertext = CryptoJS.BF.encrypt(message, key, cfg);
* var plaintext = CryptoJS.BF.decrypt(ciphertext, key, cfg);
* var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg);
* var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg);
*/
C.BF = BlockCipher._createHelper(BF);
C.Blowfish = BlockCipher._createHelper(Blowfish);
}());
8 changes: 4 additions & 4 deletions test/blowfish-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ YUI.add('algo-aes-test', function (Y) {
var C = CryptoJS;

Y.Test.Runner.add(new Y.Test.Case({
name: 'BF',
name: 'Blowfish',

setUp: function () {
this.data = {
Expand All @@ -11,7 +11,7 @@ YUI.add('algo-aes-test', function (Y) {
},

testEncrypt: function () {
let encryptedA = C.BF.encrypt('Test',
let encryptedA = C.Blowfish.encrypt('Test',
'pass',
{
salt: this.data.saltA,
Expand All @@ -21,13 +21,13 @@ YUI.add('algo-aes-test', function (Y) {
},

testDecrypt: function () {
let encryptedA = C.BF.encrypt('Test',
let encryptedA = C.Blowfish.encrypt('Test',
'pass',
{
salt: this.data.saltA,
hasher: CryptoJS.algo.SHA256
}).toString();
Y.Assert.areEqual('Test', C.BF.decrypt(encryptedA, 'pass', {hasher: CryptoJS.algo.SHA256}).toString(C.enc.Utf8));
Y.Assert.areEqual('Test', C.Blowfish.decrypt(encryptedA, 'pass', {hasher: CryptoJS.algo.SHA256}).toString(C.enc.Utf8));
}
}));
}, '$Rev$');

0 comments on commit 762feb2

Please sign in to comment.