aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/primitives
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-07 13:37:32 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-07 13:37:32 +0530
commitfb2e2f89935240666de66e4b2c11125cb3b2943d (patch)
tree7b7e148e6cce7bf7639a5e35102f5269f5920ab5 /src/crypto/primitives
parent1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca (diff)
downloadwallet-core-fb2e2f89935240666de66e4b2c11125cb3b2943d.tar.xz
more lint fixes
Diffstat (limited to 'src/crypto/primitives')
-rw-r--r--src/crypto/primitives/kdf.ts4
-rw-r--r--src/crypto/primitives/sha256.ts10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/crypto/primitives/kdf.ts b/src/crypto/primitives/kdf.ts
index 03deb3727..edc681bc1 100644
--- a/src/crypto/primitives/kdf.ts
+++ b/src/crypto/primitives/kdf.ts
@@ -51,11 +51,11 @@ export function hmac(
return digest(b2);
}
-export function hmacSha512(key: Uint8Array, message: Uint8Array) {
+export function hmacSha512(key: Uint8Array, message: Uint8Array): Uint8Array {
return hmac(sha512, 128, key, message);
}
-export function hmacSha256(key: Uint8Array, message: Uint8Array) {
+export function hmacSha256(key: Uint8Array, message: Uint8Array): Uint8Array {
return hmac(sha256, 64, key, message);
}
diff --git a/src/crypto/primitives/sha256.ts b/src/crypto/primitives/sha256.ts
index ed88b5ffd..97723dbfc 100644
--- a/src/crypto/primitives/sha256.ts
+++ b/src/crypto/primitives/sha256.ts
@@ -215,7 +215,7 @@ export class HashSha256 {
}
// Cleans internal buffers and re-initializes hash state.
- clean() {
+ clean(): void {
for (let i = 0; i < this.buffer.length; i++) {
this.buffer[i] = 0;
}
@@ -306,14 +306,14 @@ export class HashSha256 {
}
// Internal function for use in HMAC for optimization.
- _saveState(out: Uint32Array) {
+ _saveState(out: Uint32Array): void {
for (let i = 0; i < this.state.length; i++) {
out[i] = this.state[i];
}
}
// Internal function for use in HMAC for optimization.
- _restoreState(from: Uint32Array, bytesHashed: number) {
+ _restoreState(from: Uint32Array, bytesHashed: number): void {
for (let i = 0; i < this.state.length; i++) {
this.state[i] = from[i];
}
@@ -376,7 +376,7 @@ export class HMAC {
}
// Cleans HMAC state.
- clean() {
+ clean(): void {
for (let i = 0; i < this.istate.length; i++) {
this.ostate[i] = this.istate[i] = 0;
}
@@ -418,7 +418,7 @@ export function sha256(data: Uint8Array): Uint8Array {
}
// Returns HMAC-SHA256 of data under the key.
-export function hmacSha256(key: Uint8Array, data: Uint8Array) {
+export function hmacSha256(key: Uint8Array, data: Uint8Array): Uint8Array {
const h = new HMAC(key).update(data);
const digest = h.digest();
h.clean();