mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 13:30:28 +00:00
[aes-js] Counter allows for either a number or a ByteSource (#43719)
* Counter allows for either a number or a ByteSource * Add unit test
This commit is contained in:
@@ -8,3 +8,6 @@ const ecb = new aesjs.ModeOfOperation.ecb(key);
|
||||
ecb.decrypt(ecb.encrypt(data));
|
||||
|
||||
const hex: string = aesjs.utils.hex.fromBytes(data);
|
||||
|
||||
const ctr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter([]));
|
||||
ctr.encrypt(data);
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ export class AES {
|
||||
* @param initialValue The Counter initial value.
|
||||
*/
|
||||
export class Counter {
|
||||
constructor(initialValue: number)
|
||||
constructor(initialValue: number | ByteSource)
|
||||
setValue(value: number): void;
|
||||
setBytes(bytes: ByteSource): void;
|
||||
increment(): void;
|
||||
|
||||
Reference in New Issue
Block a user