Skip to content

Commit 2196faf

Browse files
committed
Merge pull request #41 from squirrelsama/master
Webpack compatibility
2 parents ed0b922 + fe3f92e commit 2196faf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/schemes/oaep.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ module.exports.eme_oaep_mgf1 = function (seed, maskLength, hashFunction) {
4848
var c = new Buffer(4);
4949
for (var i = 0; i < count; ++i) {
5050
var hash = crypt.createHash(hashFunction);
51-
hash.write(seed);
51+
hash.update(seed);
5252
c.writeUInt32BE(i, 0);
53-
hash.end(c);
54-
hash.read().copy(T, i * hLen);
53+
hash.update(c);
54+
hash.digest().copy(T, i * hLen);
5555
}
5656
return T.slice(0, maskLength);
5757
};
@@ -177,4 +177,4 @@ module.exports.makeScheme = function (key, options) {
177177
};
178178

179179
return new Scheme(key, options);
180-
};
180+
};

0 commit comments

Comments
 (0)