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/aegis256x.d.ts
CHANGED
|
@@ -1,43 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AEGIS-256X implementation with configurable parallelism degree.
|
|
3
|
+
* Extends AEGIS-256 with parallel lanes for improved performance on wide
|
|
4
|
+
* SIMD architectures. Each lane is an independent AEGIS-256 state kept in
|
|
5
|
+
* packed bitsliced form, built on the constant-time bitsliced AES core.
|
|
6
|
+
*/
|
|
1
7
|
/**
|
|
2
8
|
* AEGIS-256X cipher state with configurable parallelism degree.
|
|
3
|
-
* Extends AEGIS-256 with parallel AES rounds for improved performance on wide SIMD architectures.
|
|
4
9
|
*/
|
|
5
10
|
export declare class Aegis256XState {
|
|
6
|
-
private v;
|
|
7
11
|
private d;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
12
|
+
private rateBytes;
|
|
13
|
+
private lanes;
|
|
14
|
+
private ci;
|
|
15
|
+
private ciZero;
|
|
10
16
|
private tmp;
|
|
11
17
|
private z;
|
|
12
|
-
private ctxBufs;
|
|
13
18
|
/**
|
|
14
19
|
* Creates a new AEGIS-256X state.
|
|
15
20
|
* @param degree - Parallelism degree (default: 2). Use 2 for AEGIS-256X2, 4 for AEGIS-256X4.
|
|
16
21
|
*/
|
|
17
22
|
constructor(degree?: number);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the state blocks as byte arrays indexed [block][lane] (for testing).
|
|
25
|
+
*/
|
|
26
|
+
get v(): Uint8Array[][];
|
|
18
27
|
/**
|
|
19
28
|
* Initializes the state with a key and nonce.
|
|
20
29
|
* @param key - 32-byte encryption key
|
|
21
30
|
* @param nonce - 32-byte nonce (must be unique per message)
|
|
22
31
|
*/
|
|
23
32
|
init(key: Uint8Array, nonce: Uint8Array): void;
|
|
24
|
-
/**
|
|
25
|
-
* Updates the state with a message vector.
|
|
26
|
-
* @param m - Message vector (16*degree bytes)
|
|
27
|
-
*/
|
|
28
|
-
update(m: Uint8Array): void;
|
|
29
33
|
/**
|
|
30
34
|
* Absorbs an associated data block into the state.
|
|
31
|
-
* @param ai -
|
|
35
|
+
* @param ai - Buffer holding the 16*degree-byte associated data block
|
|
36
|
+
* @param off - Offset of the block within the buffer
|
|
32
37
|
*/
|
|
33
|
-
absorb(ai: Uint8Array): void;
|
|
34
|
-
private computeZ;
|
|
38
|
+
absorb(ai: Uint8Array, off?: number): void;
|
|
35
39
|
/**
|
|
36
40
|
* Encrypts a plaintext block and writes to output buffer.
|
|
37
|
-
* @param xi -
|
|
38
|
-
* @param out - Output buffer
|
|
41
|
+
* @param xi - Buffer holding the 16*degree-byte plaintext block
|
|
42
|
+
* @param out - Output buffer receiving the ciphertext block
|
|
43
|
+
* @param inOff - Offset of the plaintext block within xi
|
|
44
|
+
* @param outOff - Offset of the ciphertext block within out
|
|
39
45
|
*/
|
|
40
|
-
encTo(xi: Uint8Array, out: Uint8Array): void;
|
|
46
|
+
encTo(xi: Uint8Array, out: Uint8Array, inOff?: number, outOff?: number): void;
|
|
41
47
|
/**
|
|
42
48
|
* Encrypts a plaintext block.
|
|
43
49
|
* @param xi - Plaintext block (16*degree bytes)
|
|
@@ -46,25 +52,19 @@ export declare class Aegis256XState {
|
|
|
46
52
|
enc(xi: Uint8Array): Uint8Array;
|
|
47
53
|
/**
|
|
48
54
|
* Decrypts a ciphertext block and writes to output buffer.
|
|
49
|
-
* @param ci -
|
|
50
|
-
* @param out - Output buffer
|
|
55
|
+
* @param ci - Buffer holding the 16*degree-byte ciphertext block
|
|
56
|
+
* @param out - Output buffer receiving the plaintext block
|
|
57
|
+
* @param inOff - Offset of the ciphertext block within ci
|
|
58
|
+
* @param outOff - Offset of the plaintext block within out
|
|
51
59
|
*/
|
|
52
|
-
decTo(ci: Uint8Array, out: Uint8Array): void;
|
|
60
|
+
decTo(ci: Uint8Array, out: Uint8Array, inOff?: number, outOff?: number): void;
|
|
53
61
|
/**
|
|
54
62
|
* Decrypts a ciphertext block.
|
|
55
63
|
* @param ci - Ciphertext block (16*degree bytes)
|
|
56
64
|
* @returns Plaintext block of the same size
|
|
57
65
|
*/
|
|
58
66
|
dec(ci: Uint8Array): Uint8Array;
|
|
59
|
-
/**
|
|
60
|
-
* Encrypts a plaintext block in-place.
|
|
61
|
-
* @param block - Buffer (plaintext in, ciphertext out), size 16*degree bytes
|
|
62
|
-
*/
|
|
63
67
|
encInPlace(block: Uint8Array): void;
|
|
64
|
-
/**
|
|
65
|
-
* Decrypts a ciphertext block in-place.
|
|
66
|
-
* @param block - Buffer (ciphertext in, plaintext out), size 16*degree bytes
|
|
67
|
-
*/
|
|
68
68
|
decInPlace(block: Uint8Array): void;
|
|
69
69
|
/**
|
|
70
70
|
* Decrypts a partial (final) ciphertext block.
|
|
@@ -74,20 +74,20 @@ export declare class Aegis256XState {
|
|
|
74
74
|
decPartial(cn: Uint8Array): Uint8Array;
|
|
75
75
|
/**
|
|
76
76
|
* Finalizes encryption/decryption and produces an authentication tag.
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
77
|
+
* @param adLen - Associated data length in bytes
|
|
78
|
+
* @param msgLen - Message length in bytes
|
|
79
79
|
* @param tagLen - Tag length (16 or 32 bytes)
|
|
80
80
|
* @returns Authentication tag
|
|
81
81
|
*/
|
|
82
|
-
finalize(
|
|
82
|
+
finalize(adLen: number, msgLen: number, tagLen?: 16 | 32): Uint8Array;
|
|
83
83
|
/**
|
|
84
84
|
* Finalizes MAC computation and produces an authentication tag.
|
|
85
85
|
* Uses a different finalization procedure than encryption/decryption.
|
|
86
|
-
* @param
|
|
86
|
+
* @param dataLen - Data length in bytes
|
|
87
87
|
* @param tagLen - Tag length (16 or 32 bytes)
|
|
88
88
|
* @returns Authentication tag
|
|
89
89
|
*/
|
|
90
|
-
finalizeMac(
|
|
90
|
+
finalizeMac(dataLen: number, tagLen?: 16 | 32): Uint8Array;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Encrypts a message using AEGIS-256X (detached mode).
|
|
@@ -243,4 +243,3 @@ export declare const aegis256X2CreateNonce: typeof aegis256XCreateNonce;
|
|
|
243
243
|
export declare const aegis256X4CreateKey: typeof aegis256XCreateKey;
|
|
244
244
|
/** AEGIS-256X4 nonce generation (degree=4). */
|
|
245
245
|
export declare const aegis256X4CreateNonce: typeof aegis256XCreateNonce;
|
|
246
|
-
//# sourceMappingURL=aegis256x.d.ts.map
|