sha256: minor.

This commit is contained in:
Christopher Jeffrey 2017-02-01 18:53:39 -08:00
parent c225f67bfc
commit 91af611866
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -251,23 +251,22 @@ SHA256Hmac.prototype.init = function init(data) {
this.inner.init();
this.inner.update(data);
this.inner._finish(key);
key.fill(0, 32);
key.fill(0, 32, 64);
} else {
data.copy(key, 0);
key.fill(0, data.length, 64);
}
this.inner.init();
this.outer.init();
for (i = 0; i < key.length; i++)
key[i] ^= 0x36;
this.inner.init();
this.inner.update(key);
for (i = 0; i < key.length; i++)
key[i] ^= 0x6a;
this.outer.init();
this.outer.update(key);
};