Skip to content

Commit 66f5323

Browse files
committed
code style fix
1 parent b4547a7 commit 66f5323

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

src/libs/jsbn.js

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,25 @@ function nbv(i) {
182182
// (protected) set from string and radix
183183
function bnpFromString(data, radix, unsigned) {
184184
var k;
185-
switch(radix) {
186-
case 2: k=1; break;
187-
case 4: k=2; break;
188-
case 8: k=3; break;
189-
case 16: k=4; break;
190-
case 32: k=5; break;
191-
case 256: k=8; break;
185+
switch (radix) {
186+
case 2:
187+
k = 1;
188+
break;
189+
case 4:
190+
k = 2;
191+
break;
192+
case 8:
193+
k = 3;
194+
break;
195+
case 16:
196+
k = 4;
197+
break;
198+
case 32:
199+
k = 5;
200+
break;
201+
case 256:
202+
k = 8;
203+
break;
192204
default:
193205
this.fromRadix(data, radix);
194206
return;
@@ -839,13 +851,13 @@ function bnToBuffer(trimOrSize) {
839851
}
840852

841853
function bnEquals(a) {
842-
return(this.compareTo(a) == 0);
854+
return (this.compareTo(a) == 0);
843855
}
844856
function bnMin(a) {
845-
return(this.compareTo(a) < 0) ? this : a;
857+
return (this.compareTo(a) < 0) ? this : a;
846858
}
847859
function bnMax(a) {
848-
return(this.compareTo(a) > 0) ? this : a;
860+
return (this.compareTo(a) > 0) ? this : a;
849861
}
850862

851863
//(protected) r = this op a (bitwise)
@@ -981,8 +993,8 @@ function bnBitCount() {
981993
//(public) true iff nth bit is set
982994
function bnTestBit(n) {
983995
var j = Math.floor(n / this.DB);
984-
if (j >= this.t) return(this.s != 0);
985-
return((this[j] & (1 << (n % this.DB))) != 0);
996+
if (j >= this.t) return (this.s != 0);
997+
return ((this[j] & (1 << (n % this.DB))) != 0);
986998
}
987999

9881000
//(protected) this op (1<<n)

src/schemes/oaep.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports.makeScheme = function (key, options) {
7676
var hash = this.options.encryptionSchemeOptions.hash || DEFAULT_HASH_FUNCTION;
7777
var mgf = this.options.encryptionSchemeOptions.mgf || module.exports.eme_oaep_mgf1;
7878
var label = this.options.encryptionSchemeOptions.label || new Buffer(0);
79-
var emLen = this.key.encryptedDataLength;
79+
var emLen = this.key.encryptedDataLength;
8080

8181
var hLen = module.exports.digestLength[hash];
8282

0 commit comments

Comments
 (0)