-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from dajiaji/breaking-changes-for-1_0_0
Breaking changes for 1.0.0
- Loading branch information
Showing
27 changed files
with
2,832 additions
and
1,418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import { chacha20_poly1305 } from "npm:@noble/[email protected]/chacha"; | ||
|
||
import type { AeadKey } from "../interfaces/aeadKey.ts"; | ||
import type { AeadEncryptionContext } from "../interfaces/aeadEncryptionContext.ts"; | ||
import type { AeadInterface } from "../interfaces/aeadInterface.ts"; | ||
|
||
import { Algorithm } from "../algorithm.ts"; | ||
import { AeadId } from "../identifiers.ts"; | ||
|
||
export class Chacha20Poly1305Key implements AeadKey { | ||
public readonly id: AeadId = AeadId.Chacha20Poly1305; | ||
public readonly keySize: number = 32; | ||
public readonly nonceSize: number = 12; | ||
public readonly tagSize: number = 16; | ||
export class Chacha20Poly1305Context implements AeadEncryptionContext { | ||
private _key: Uint8Array; | ||
private _api: SubtleCrypto; | ||
|
||
|
@@ -72,7 +68,7 @@ export class Chacha20Poly1305 extends Algorithm implements AeadInterface { | |
public readonly nonceSize: number = 12; | ||
public readonly tagSize: number = 16; | ||
|
||
public createAeadKey(key: ArrayBuffer): AeadKey { | ||
return new Chacha20Poly1305Key(this._api as SubtleCrypto, key); | ||
public createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext { | ||
return new Chacha20Poly1305Context(this._api as SubtleCrypto, key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.