Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix private function name. #234

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/aeads/aesGcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AesGcmContext implements AeadEncryptionContext {
aad: ArrayBuffer,
): Promise<ArrayBuffer> {
if (this._key === undefined) {
this._key = await this.importKey(this._rawKey);
this._key = await this._importKey(this._rawKey);
(new Uint8Array(this._rawKey)).fill(0);
}
const alg = {
Expand All @@ -43,7 +43,7 @@ export class AesGcmContext implements AeadEncryptionContext {
aad: ArrayBuffer,
): Promise<ArrayBuffer> {
if (this._key === undefined) {
this._key = await this.importKey(this._rawKey);
this._key = await this._importKey(this._rawKey);
(new Uint8Array(this._rawKey)).fill(0);
}
const alg = {
Expand All @@ -59,7 +59,7 @@ export class AesGcmContext implements AeadEncryptionContext {
return pt;
}

private async importKey(key: ArrayBuffer): Promise<CryptoKey> {
private async _importKey(key: ArrayBuffer): Promise<CryptoKey> {
return await this._api.importKey(
"raw",
key,
Expand Down
6 changes: 3 additions & 3 deletions src/kems/dhkem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Dhkem extends Algorithm implements KemInterface {
new Uint8Array(pksm),
);
}
const sharedSecret = await this.generateSharedSecret(dh, kemContext);
const sharedSecret = await this._generateSharedSecret(dh, kemContext);
return {
enc: enc,
sharedSecret: sharedSecret,
Expand Down Expand Up @@ -178,13 +178,13 @@ export class Dhkem extends Algorithm implements KemInterface {
params.enc.byteLength + pkrm.byteLength,
);
}
return await this.generateSharedSecret(dh, kemContext);
return await this._generateSharedSecret(dh, kemContext);
} catch (e: unknown) {
throw new errors.DecapError(e);
}
}

private async generateSharedSecret(
private async _generateSharedSecret(
dh: Uint8Array,
kemContext: Uint8Array,
): Promise<ArrayBuffer> {
Expand Down
Loading