aegis-aead 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -20
- package/dist/aegis128l.d.ts +33 -33
- package/dist/aegis128l.js +225 -235
- package/dist/aegis128x.d.ts +35 -35
- package/dist/aegis128x.js +348 -282
- package/dist/aegis256.d.ts +34 -51
- package/dist/aegis256.js +215 -206
- package/dist/aegis256x.d.ts +32 -33
- package/dist/aegis256x.js +333 -265
- package/dist/aes-bs.d.ts +42 -35
- package/dist/aes-bs.js +2269 -401
- package/dist/index.d.ts +4 -7
- package/dist/index.js +4 -7
- package/dist/random.d.ts +0 -1
- package/dist/random.js +0 -1
- package/dist/utils.d.ts +14 -0
- package/dist/utils.js +31 -0
- package/package.json +5 -6
- package/dist/aegis128l-bs.d.ts +0 -137
- package/dist/aegis128l-bs.d.ts.map +0 -1
- package/dist/aegis128l-bs.js +0 -442
- package/dist/aegis128l-bs.js.map +0 -1
- package/dist/aegis128l.d.ts.map +0 -1
- package/dist/aegis128l.js.map +0 -1
- package/dist/aegis128x.d.ts.map +0 -1
- package/dist/aegis128x.js.map +0 -1
- package/dist/aegis256-bs.d.ts +0 -79
- package/dist/aegis256-bs.d.ts.map +0 -1
- package/dist/aegis256-bs.js +0 -366
- package/dist/aegis256-bs.js.map +0 -1
- package/dist/aegis256.d.ts.map +0 -1
- package/dist/aegis256.js.map +0 -1
- package/dist/aegis256x.d.ts.map +0 -1
- package/dist/aegis256x.js.map +0 -1
- package/dist/aes-bs.d.ts.map +0 -1
- package/dist/aes-bs.js.map +0 -1
- package/dist/aes.d.ts +0 -81
- package/dist/aes.d.ts.map +0 -1
- package/dist/aes.js +0 -232
- package/dist/aes.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/random.d.ts.map +0 -1
- package/dist/random.js.map +0 -1
- package/src/aegis128l-bs.ts +0 -600
- package/src/aegis128l.ts +0 -653
- package/src/aegis128x.ts +0 -932
- package/src/aegis256-bs.ts +0 -519
- package/src/aegis256.ts +0 -597
- package/src/aegis256x.ts +0 -893
- package/src/aes-bs.ts +0 -540
- package/src/aes.ts +0 -271
- package/src/index.ts +0 -126
- package/src/random.ts +0 -41
- package/src/typed-array.d.ts +0 -18
package/dist/aegis256.d.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AEGIS-256 implementation.
|
|
3
|
+
* Built on the constant-time bitsliced AES core, which processes the state
|
|
4
|
+
* blocks simultaneously without lookup tables.
|
|
5
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* AEGIS-256 cipher state.
|
|
3
|
-
* Uses 6 AES blocks
|
|
8
|
+
* Uses 6 AES blocks stored in packed bitsliced form throughout the lifetime
|
|
9
|
+
* of the state.
|
|
4
10
|
*/
|
|
5
11
|
export declare class Aegis256State {
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private s2;
|
|
9
|
-
private s3;
|
|
10
|
-
private s4;
|
|
11
|
-
private s5;
|
|
12
|
+
private st;
|
|
13
|
+
private constantInput;
|
|
12
14
|
private tmp;
|
|
13
15
|
private z;
|
|
14
|
-
private newS;
|
|
15
|
-
private tBuf;
|
|
16
16
|
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Returns the 6 state blocks as byte arrays (for testing).
|
|
19
|
+
*/
|
|
17
20
|
get s(): Uint8Array[];
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Sets the 6 state blocks from byte arrays (for testing).
|
|
23
|
+
*/
|
|
24
|
+
set s(blocks: Uint8Array[]);
|
|
19
25
|
/**
|
|
20
26
|
* Initializes the state with a key and nonce.
|
|
21
27
|
* @param key - 32-byte encryption key
|
|
@@ -24,62 +30,40 @@ export declare class Aegis256State {
|
|
|
24
30
|
init(key: Uint8Array, nonce: Uint8Array): void;
|
|
25
31
|
/**
|
|
26
32
|
* Updates the state with a 16-byte message block.
|
|
27
|
-
* @param m -
|
|
33
|
+
* @param m - 16-byte message block
|
|
28
34
|
*/
|
|
29
|
-
update(m:
|
|
35
|
+
update(m: Uint8Array): void;
|
|
30
36
|
/**
|
|
31
37
|
* Absorbs a 16-byte associated data block into the state.
|
|
32
|
-
* @param ai - 16-byte associated data block
|
|
33
|
-
|
|
34
|
-
absorb(ai: Uint8Array): void;
|
|
35
|
-
/**
|
|
36
|
-
* Encrypts a 16-byte plaintext block and writes to output.
|
|
37
|
-
* @param xi - 16-byte plaintext block
|
|
38
|
-
* @param out - 16-byte output buffer
|
|
38
|
+
* @param ai - Buffer holding the 16-byte associated data block
|
|
39
|
+
* @param off - Offset of the block within the buffer
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
absorb(ai: Uint8Array, off?: number): void;
|
|
41
42
|
/**
|
|
42
|
-
* Encrypts a 16-byte plaintext block.
|
|
43
|
-
* @param xi - 16-byte plaintext block
|
|
44
|
-
* @
|
|
43
|
+
* Encrypts a 16-byte plaintext block and writes to output buffer.
|
|
44
|
+
* @param xi - Buffer holding the 16-byte plaintext block
|
|
45
|
+
* @param out - Output buffer receiving the 16-byte ciphertext block
|
|
46
|
+
* @param inOff - Offset of the plaintext block within xi
|
|
47
|
+
* @param outOff - Offset of the ciphertext block within out
|
|
45
48
|
*/
|
|
49
|
+
encTo(xi: Uint8Array, out: Uint8Array, inOff?: number, outOff?: number): void;
|
|
46
50
|
enc(xi: Uint8Array): Uint8Array;
|
|
47
51
|
/**
|
|
48
|
-
* Decrypts a 16-byte ciphertext block and writes to output.
|
|
49
|
-
* @param ci - 16-byte ciphertext block
|
|
50
|
-
* @param out - 16-byte
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Decrypts a 16-byte ciphertext block.
|
|
55
|
-
* @param ci - 16-byte ciphertext block
|
|
56
|
-
* @returns 16-byte plaintext block
|
|
52
|
+
* Decrypts a 16-byte ciphertext block and writes to output buffer.
|
|
53
|
+
* @param ci - Buffer holding the 16-byte ciphertext block
|
|
54
|
+
* @param out - Output buffer receiving the 16-byte plaintext block
|
|
55
|
+
* @param inOff - Offset of the ciphertext block within ci
|
|
56
|
+
* @param outOff - Offset of the plaintext block within out
|
|
57
57
|
*/
|
|
58
|
+
decTo(ci: Uint8Array, out: Uint8Array, inOff?: number, outOff?: number): void;
|
|
58
59
|
dec(ci: Uint8Array): Uint8Array;
|
|
59
|
-
/**
|
|
60
|
-
* Encrypts a 16-byte plaintext block in-place.
|
|
61
|
-
* @param block - 16-byte buffer (plaintext in, ciphertext out)
|
|
62
|
-
*/
|
|
63
60
|
encInPlace(block: Uint8Array): void;
|
|
64
|
-
/**
|
|
65
|
-
* Decrypts a 16-byte ciphertext block in-place.
|
|
66
|
-
* @param block - 16-byte buffer (ciphertext in, plaintext out)
|
|
67
|
-
*/
|
|
68
61
|
decInPlace(block: Uint8Array): void;
|
|
69
|
-
/**
|
|
70
|
-
* Decrypts a partial (final) ciphertext block smaller than 16 bytes.
|
|
71
|
-
* @param cn - Partial ciphertext block (1-15 bytes)
|
|
72
|
-
* @returns Decrypted plaintext of the same length
|
|
73
|
-
*/
|
|
74
62
|
decPartial(cn: Uint8Array): Uint8Array;
|
|
75
63
|
/**
|
|
76
64
|
* Finalizes encryption/decryption and produces an authentication tag.
|
|
77
|
-
* @param adLenBits - Associated data length in bits
|
|
78
|
-
* @param msgLenBits - Message length in bits
|
|
79
|
-
* @param tagLen - Tag length (16 or 32 bytes)
|
|
80
|
-
* @returns Authentication tag
|
|
81
65
|
*/
|
|
82
|
-
finalize(
|
|
66
|
+
finalize(adLen: number, msgLen: number, tagLen?: 16 | 32): Uint8Array;
|
|
83
67
|
}
|
|
84
68
|
/**
|
|
85
69
|
* Encrypts a message using AEGIS-256 (detached mode).
|
|
@@ -181,4 +165,3 @@ export declare function aegis256CreateKey(): Uint8Array;
|
|
|
181
165
|
* @throws Error if no cryptographic random source is available
|
|
182
166
|
*/
|
|
183
167
|
export declare function aegis256CreateNonce(): Uint8Array;
|
|
184
|
-
//# sourceMappingURL=aegis256.d.ts.map
|