@mavogel/awscdk-rootmail 0.1.33 → 0.1.35
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/.jsii +8 -8
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js +2 -1
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js +464 -40
- package/node_modules/@aws-sdk/checksums/dist-cjs/submodules/xxh/index.js +914 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/flexible-checksums/stringUnionSelector.js +2 -1
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.browser.js +2 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512.js +71 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512Js.js +276 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512WebCrypto.js +76 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/U64.js +190 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/Xxh3.js +274 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/index.js +3 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_128/Xxh3_128.js +179 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_64/Xxh3_64.js +117 -0
- package/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash64/Xxh64.js +150 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512Js.d.ts +29 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512WebCrypto.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/U64.d.ts +110 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/Xxh3.d.ts +139 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +37 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash64/Xxh64.d.ts +41 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.browser.d.ts +2 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512Js.d.ts +22 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512WebCrypto.d.ts +14 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/U64.d.ts +27 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/Xxh3.d.ts +65 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/index.d.ts +3 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +12 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +10 -0
- package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash64/Xxh64.d.ts +17 -0
- package/node_modules/@aws-sdk/checksums/package.json +13 -3
- package/node_modules/@aws-sdk/checksums/xxh.d.ts +5 -0
- package/node_modules/@aws-sdk/checksums/xxh.js +5 -0
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-s3/package.json +7 -7
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +3 -3
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
- package/node_modules/@aws-sdk/core/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js +34 -16
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3-control/index.js +6 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-bucket-endpoint/bucketHostnameUtils.js +6 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.js +8 -4
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.js +18 -8
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-ssec/middleware-ssec.js +2 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-process-arnables/parse-outpost-arnables.js +4 -2
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-redirect-from-postid/redirect-from-postid.js +2 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
- package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
- package/node_modules/mailparser/CHANGELOG.md +26 -0
- package/node_modules/mailparser/README.md +21 -1
- package/node_modules/mailparser/dist/cjs/index.d.ts +3 -1
- package/node_modules/mailparser/dist/cjs/index.js +4 -2
- package/node_modules/mailparser/dist/cjs/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/cjs/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/cjs/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/cjs/otp-token.js +186 -0
- package/node_modules/mailparser/dist/cjs/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/cjs/types.d.ts +21 -0
- package/node_modules/mailparser/dist/esm/index.d.ts +3 -1
- package/node_modules/mailparser/dist/esm/index.js +3 -2
- package/node_modules/mailparser/dist/esm/mail-parser.d.ts +8 -1
- package/node_modules/mailparser/dist/esm/mail-parser.js +5 -0
- package/node_modules/mailparser/dist/esm/otp-token.d.ts +9 -0
- package/node_modules/mailparser/dist/esm/otp-token.js +180 -0
- package/node_modules/mailparser/dist/esm/simple-parser.js +3 -0
- package/node_modules/mailparser/dist/esm/types.d.ts +21 -0
- package/node_modules/mailparser/package.json +3 -3
- package/node_modules/nodemailer/CHANGELOG.md +19 -0
- package/node_modules/nodemailer/dist/cjs/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/cjs/errors.js +3 -1
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/esm/dkim/sign.js +1 -1
- package/node_modules/nodemailer/dist/esm/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/esm/errors.js +2 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +12 -0
- package/node_modules/nodemailer/dist/esm/mail-composer/index.js +53 -0
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +3 -2
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +10 -2
- package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/well-known/services.json +8 -0
- package/node_modules/nodemailer/package.json +5 -5
- package/package.json +7 -7
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { m32, U64 } from "../U64";
|
|
2
|
+
const P = U64.create(6)
|
|
3
|
+
.write(0, 0b10011110001101110111100110110001, 0b10000101111010111100101010000111)
|
|
4
|
+
.write(1, 0b11000010101100101010111000111101, 0b00100111110101001110101101001111)
|
|
5
|
+
.write(3, 0b00010110010101100110011110110001, 0b10011110001101110111100111111001)
|
|
6
|
+
.write(4, 0b10000101111010111100101001110111, 0b11000010101100101010111001100011)
|
|
7
|
+
.write(5, 0b00100111110101001110101100101111, 0b00010110010101100110011111000101);
|
|
8
|
+
P.copy(0, 2).add(2, P.hi(1), P.lo(1));
|
|
9
|
+
const P1 = 0;
|
|
10
|
+
const P2 = 1;
|
|
11
|
+
const P1_2 = 2;
|
|
12
|
+
const P3 = 3;
|
|
13
|
+
const P4 = 4;
|
|
14
|
+
const P5 = 5;
|
|
15
|
+
const SEED = 0;
|
|
16
|
+
const ACC0 = 1;
|
|
17
|
+
const ACC1 = 2;
|
|
18
|
+
const ACC2 = 3;
|
|
19
|
+
const ACC3 = 4;
|
|
20
|
+
const T0 = 5;
|
|
21
|
+
const T1 = 6;
|
|
22
|
+
const T2 = 7;
|
|
23
|
+
export class Xxh64 {
|
|
24
|
+
digestLength = 8;
|
|
25
|
+
byteCount = 0;
|
|
26
|
+
mem = U64.create(8);
|
|
27
|
+
stripeBuffer = new Uint8Array(32);
|
|
28
|
+
bufferIndex = 0;
|
|
29
|
+
constructor() {
|
|
30
|
+
this.mem.write(SEED, 0, 0);
|
|
31
|
+
this.reset();
|
|
32
|
+
}
|
|
33
|
+
update(chunk) {
|
|
34
|
+
this.byteCount += chunk.byteLength;
|
|
35
|
+
this._update(chunk);
|
|
36
|
+
}
|
|
37
|
+
_update(chunk) {
|
|
38
|
+
if (this.bufferIndex !== 0 && this.bufferIndex + chunk.byteLength >= 32) {
|
|
39
|
+
const bytesFilled = 32 - this.bufferIndex;
|
|
40
|
+
for (let i = 0; i < bytesFilled; ++i) {
|
|
41
|
+
this.stripeBuffer[this.bufferIndex++] = chunk[i];
|
|
42
|
+
}
|
|
43
|
+
this.processStripe(this.stripeBuffer);
|
|
44
|
+
this.bufferIndex = 0;
|
|
45
|
+
return this._update(chunk.subarray(bytesFilled));
|
|
46
|
+
}
|
|
47
|
+
if (chunk.byteLength < 32) {
|
|
48
|
+
for (let i = 0; i < chunk.byteLength; ++i) {
|
|
49
|
+
this.stripeBuffer[this.bufferIndex++] = chunk[i];
|
|
50
|
+
if (this.bufferIndex === this.stripeBuffer.byteLength) {
|
|
51
|
+
this.bufferIndex = 0;
|
|
52
|
+
this.processStripe(this.stripeBuffer);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
for (let i = 0; i < chunk.byteLength; i += 32) {
|
|
58
|
+
const chunkLen = Math.min(i + 32, chunk.byteLength) - i;
|
|
59
|
+
const subchunk = chunk.subarray(i, i + chunkLen);
|
|
60
|
+
if (chunkLen < 32) {
|
|
61
|
+
return this._update(subchunk);
|
|
62
|
+
}
|
|
63
|
+
this.processStripe(subchunk);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async digest() {
|
|
68
|
+
const { mem, byteCount } = this;
|
|
69
|
+
const m = T0;
|
|
70
|
+
if (byteCount < 32) {
|
|
71
|
+
mem.copy(SEED, m).add(m, P.hi(P5), P.lo(P5));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
mem.copy(ACC0, T1).rotateLeft(T1, 1);
|
|
75
|
+
mem.write(m, mem.hi(T1), mem.lo(T1));
|
|
76
|
+
mem.copy(ACC1, T1).rotateLeft(T1, 7);
|
|
77
|
+
mem.add(m, mem.hi(T1), mem.lo(T1));
|
|
78
|
+
mem.copy(ACC2, T1).rotateLeft(T1, 12);
|
|
79
|
+
mem.add(m, mem.hi(T1), mem.lo(T1));
|
|
80
|
+
mem.copy(ACC3, T1).rotateLeft(T1, 18);
|
|
81
|
+
mem.add(m, mem.hi(T1), mem.lo(T1));
|
|
82
|
+
this.mergeAcc(m, ACC0);
|
|
83
|
+
this.mergeAcc(m, ACC1);
|
|
84
|
+
this.mergeAcc(m, ACC2);
|
|
85
|
+
this.mergeAcc(m, ACC3);
|
|
86
|
+
}
|
|
87
|
+
mem.add(m, Math.floor(byteCount / m32), byteCount & m32);
|
|
88
|
+
let rem = this.bufferIndex;
|
|
89
|
+
let ptr = 0;
|
|
90
|
+
const b = this.stripeBuffer;
|
|
91
|
+
while (rem >= 8) {
|
|
92
|
+
const v1 = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
93
|
+
const v0 = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
94
|
+
mem.write(T1, 0, 0);
|
|
95
|
+
this.roundAt(T1, v0, v1);
|
|
96
|
+
mem.xor(m, mem.hi(T1), mem.lo(T1)).rotateLeft(m, 27).multiply(m, P.hi(P1), P.lo(P1)).add(m, P.hi(P4), P.lo(P4));
|
|
97
|
+
rem -= 8;
|
|
98
|
+
}
|
|
99
|
+
while (rem >= 4) {
|
|
100
|
+
const lo = b[ptr++] | (b[ptr++] << 8) | (b[ptr++] << 16) | ((b[ptr++] << 24) >>> 0);
|
|
101
|
+
mem.write(T1, 0, lo).multiply(T1, P.hi(P1), P.lo(P1));
|
|
102
|
+
mem.xor(m, mem.hi(T1), mem.lo(T1)).rotateLeft(m, 23).multiply(m, P.hi(P2), P.lo(P2)).add(m, P.hi(P3), P.lo(P3));
|
|
103
|
+
rem -= 4;
|
|
104
|
+
}
|
|
105
|
+
while (rem >= 1) {
|
|
106
|
+
mem.write(T1, 0, b[ptr++]).multiply(T1, P.hi(P5), P.lo(P5));
|
|
107
|
+
mem.xor(m, mem.hi(T1), mem.lo(T1)).rotateLeft(m, 11).multiply(m, P.hi(P1), P.lo(P1));
|
|
108
|
+
rem -= 1;
|
|
109
|
+
}
|
|
110
|
+
this.avalanche(m);
|
|
111
|
+
return mem.toBytes(m);
|
|
112
|
+
}
|
|
113
|
+
reset() {
|
|
114
|
+
const { mem } = this;
|
|
115
|
+
this.byteCount = 0;
|
|
116
|
+
this.bufferIndex = 0;
|
|
117
|
+
mem.copy(SEED, ACC0).add(ACC0, P.hi(P1_2), P.lo(P1_2));
|
|
118
|
+
mem.copy(SEED, ACC1).add(ACC1, P.hi(P2), P.lo(P2));
|
|
119
|
+
mem.copy(SEED, ACC2);
|
|
120
|
+
mem.copy(SEED, ACC3).subtract(ACC3, P.hi(P1), P.lo(P1));
|
|
121
|
+
}
|
|
122
|
+
processStripe(stripe) {
|
|
123
|
+
for (let i = 0; i < 4; ++i) {
|
|
124
|
+
const ix = i * 8;
|
|
125
|
+
const v1 = stripe[ix] | (stripe[ix + 1] << 8) | (stripe[ix + 2] << 16) | ((stripe[ix + 3] << 24) >>> 0);
|
|
126
|
+
const v0 = stripe[ix + 4] | (stripe[ix + 5] << 8) | (stripe[ix + 6] << 16) | ((stripe[ix + 7] << 24) >>> 0);
|
|
127
|
+
this.roundAt(ACC0 + i, v0, v1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
mergeAcc(m, acc) {
|
|
131
|
+
const { mem } = this;
|
|
132
|
+
mem.write(T1, 0, 0);
|
|
133
|
+
this.roundAt(T1, mem.hi(acc), mem.lo(acc));
|
|
134
|
+
mem.xor(m, mem.hi(T1), mem.lo(T1)).multiply(m, P.hi(P1), P.lo(P1)).add(m, P.hi(P4), P.lo(P4));
|
|
135
|
+
}
|
|
136
|
+
roundAt(i, v0, v1) {
|
|
137
|
+
const { mem } = this;
|
|
138
|
+
mem.write(T2, v0, v1).multiply(T2, P.hi(P2), P.lo(P2));
|
|
139
|
+
mem.add(i, mem.hi(T2), mem.lo(T2)).rotateLeft(i, 31).multiply(i, P.hi(P1), P.lo(P1));
|
|
140
|
+
}
|
|
141
|
+
avalanche(i) {
|
|
142
|
+
const { mem } = this;
|
|
143
|
+
mem.copy(i, T1).right(T1, 33);
|
|
144
|
+
mem.xor(i, mem.hi(T1), mem.lo(T1)).multiply(i, P.hi(P2), P.lo(P2));
|
|
145
|
+
mem.copy(i, T1).right(T1, 29);
|
|
146
|
+
mem.xor(i, mem.hi(T1), mem.lo(T1)).multiply(i, P.hi(P3), P.lo(P3));
|
|
147
|
+
mem.copy(i, T1).right(T1, 32);
|
|
148
|
+
mem.xor(i, mem.hi(T1), mem.lo(T1));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Sha1Js, Sha1Js as Sha1 } from "./sha1/Sha1Js";
|
|
2
2
|
export declare const Sha1Node: symbol;
|
|
3
|
+
export { Sha512WebCrypto, Sha512WebCrypto as Sha512 } from "./sha512/Sha512WebCrypto";
|
|
4
|
+
export { Sha512Js } from "./sha512/Sha512Js";
|
|
3
5
|
export { Sha256, Sha256Js, Sha256Node, Sha256WebCrypto } from "@smithy/core/checksum";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { Sha1Js } from "./sha1/Sha1Js";
|
|
2
2
|
export { Sha1Node, Sha1Node as Sha1 } from "./sha1/Sha1Node";
|
|
3
3
|
export { Sha1WebCrypto } from "./sha1/Sha1WebCrypto";
|
|
4
|
+
export { Sha512 } from "./sha512/Sha512";
|
|
5
|
+
export { Sha512Js } from "./sha512/Sha512Js";
|
|
6
|
+
export { Sha512WebCrypto } from "./sha512/Sha512WebCrypto";
|
|
4
7
|
export { Sha256, Sha256Js, Sha256Node } from "@smithy/core/checksum";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SourceData } from "@smithy/types";
|
|
2
|
+
import { Sha512Js } from "./Sha512Js";
|
|
3
|
+
/**
|
|
4
|
+
* SHA-512, using Node.js native crypto when available and falling back to the
|
|
5
|
+
* inherited pure-JS implementation otherwise.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class Sha512 extends Sha512Js {
|
|
9
|
+
private native?;
|
|
10
|
+
private readonly nativeSecret?;
|
|
11
|
+
private nativeFinished;
|
|
12
|
+
constructor(secret?: SourceData);
|
|
13
|
+
update(data: Uint8Array): void;
|
|
14
|
+
digest(): Promise<Uint8Array>;
|
|
15
|
+
reset(): void;
|
|
16
|
+
private createNative;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Checksum, SourceData } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* Pure JS SHA-512 implementation with HMAC support.
|
|
4
|
+
* 64-bit words are held as [hi, lo] u32 pairs; all arithmetic is split accordingly.
|
|
5
|
+
* Non-destructive digest for plain hash — safe to call digest() multiple times.
|
|
6
|
+
* @see https://csrc.nist.gov/pubs/fips/180-4/upd1/final
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare class Sha512Js implements Checksum {
|
|
10
|
+
readonly digestLength = 64;
|
|
11
|
+
private state;
|
|
12
|
+
private w?;
|
|
13
|
+
private buffer;
|
|
14
|
+
private bufferLength;
|
|
15
|
+
private bytesHashed;
|
|
16
|
+
private finished;
|
|
17
|
+
private readonly key?;
|
|
18
|
+
private inner?;
|
|
19
|
+
private outer?;
|
|
20
|
+
constructor(secret?: SourceData);
|
|
21
|
+
update(data: Uint8Array): void;
|
|
22
|
+
digest(): Promise<Uint8Array>;
|
|
23
|
+
reset(): void;
|
|
24
|
+
private initHmac;
|
|
25
|
+
private digestSync;
|
|
26
|
+
private static normalizeKey;
|
|
27
|
+
private hashBuffer;
|
|
28
|
+
private hashBufferWith;
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Checksum, SourceData } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* SHA-512 using the Web Crypto API (crypto.subtle) when available,
|
|
4
|
+
* falling back to the pure JS implementation.
|
|
5
|
+
*
|
|
6
|
+
* Caution: WebCrypto digest() needs the whole message at once, so data is
|
|
7
|
+
* buffered until MAX_PENDING_BYTES, then streamed through Sha512Js instead.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare class Sha512WebCrypto implements Checksum {
|
|
11
|
+
readonly digestLength: 64;
|
|
12
|
+
private readonly secret?;
|
|
13
|
+
private pending;
|
|
14
|
+
private pendingBytes;
|
|
15
|
+
private fallback?;
|
|
16
|
+
private finished;
|
|
17
|
+
constructor(secret?: SourceData);
|
|
18
|
+
update(data: Uint8Array): void;
|
|
19
|
+
digest(): Promise<Uint8Array>;
|
|
20
|
+
reset(): void;
|
|
21
|
+
private switchToFallback;
|
|
22
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export type u32 = number;
|
|
5
|
+
/**
|
|
6
|
+
* Larger (left) 32 bits of a u64.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type u64_l = u32;
|
|
10
|
+
/**
|
|
11
|
+
* Low (right) 32 bits of a u64.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export type u64_r = u32;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export type index = number;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export type distance = number;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export type size = number;
|
|
27
|
+
/**
|
|
28
|
+
* 8-bit mask.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare const m8 = 255;
|
|
32
|
+
/**
|
|
33
|
+
* 16-bit mask.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare const m16 = 65535;
|
|
37
|
+
/**
|
|
38
|
+
* 32-bit mask.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare const m32 = 4294967295;
|
|
42
|
+
/**
|
|
43
|
+
* Fixed-length allocation of u64 values stored as pairs of u32 in a Uint32Array.
|
|
44
|
+
* Slot i occupies indices [i*2, i*2+1] where [0]=high bits, [1]=low bits.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare class U64 extends Uint32Array {
|
|
49
|
+
private constructor();
|
|
50
|
+
/**
|
|
51
|
+
* Creates a U64
|
|
52
|
+
*
|
|
53
|
+
* @param size - number of U32 pairs.
|
|
54
|
+
*/
|
|
55
|
+
static create(size: index): U64;
|
|
56
|
+
/**
|
|
57
|
+
* Set pair at slot i.
|
|
58
|
+
*/
|
|
59
|
+
write(i: index, v0: u64_l, v1: u64_r): U64;
|
|
60
|
+
/**
|
|
61
|
+
* Copy pair from slot source to target.
|
|
62
|
+
*/
|
|
63
|
+
copy(source: index, target: index): U64;
|
|
64
|
+
/**
|
|
65
|
+
* Add in-place at [i].
|
|
66
|
+
*/
|
|
67
|
+
add(i: index, v0: u64_l, v1: u64_r): U64;
|
|
68
|
+
/**
|
|
69
|
+
* Multiply in-place at [i].
|
|
70
|
+
*/
|
|
71
|
+
multiply(i: index, v0: u64_l, v1: u64_r): U64;
|
|
72
|
+
/**
|
|
73
|
+
* [i] += a * b.
|
|
74
|
+
*/
|
|
75
|
+
addProduct(i: index, a: u32, b: u32): U64;
|
|
76
|
+
/**
|
|
77
|
+
* 64×64→128-bit multiplication.
|
|
78
|
+
* Multiplies slot `i` by slot `j`, stores high 64 bits in `t` and low 64 bits in `u`.
|
|
79
|
+
*/
|
|
80
|
+
multiply128(i: index, j: index, t: index, u: index): U64;
|
|
81
|
+
/**
|
|
82
|
+
* Subtract in-place at [i].
|
|
83
|
+
*/
|
|
84
|
+
subtract(i: index, v0: u64_l, v1: u64_r): U64;
|
|
85
|
+
/**
|
|
86
|
+
* Left shift in-place at [i].
|
|
87
|
+
*/
|
|
88
|
+
left(i: index, places: distance): U64;
|
|
89
|
+
/**
|
|
90
|
+
* Rotate left (circular shift) at [i].
|
|
91
|
+
*/
|
|
92
|
+
rotateLeft(i: index, places: distance): U64;
|
|
93
|
+
/**
|
|
94
|
+
* Right shift in-place at [i].
|
|
95
|
+
*/
|
|
96
|
+
right(i: index, places: distance): U64;
|
|
97
|
+
/**
|
|
98
|
+
* XOR in-place at [i].
|
|
99
|
+
*/
|
|
100
|
+
xor(i: index, v0: u64_l, v1: u64_r): U64;
|
|
101
|
+
toBytes(i: index): Uint8Array;
|
|
102
|
+
/**
|
|
103
|
+
* Read the high 32 bits of slot i.
|
|
104
|
+
*/
|
|
105
|
+
hi(i: index): u64_l;
|
|
106
|
+
/**
|
|
107
|
+
* Read the low 32 bits of slot i.
|
|
108
|
+
*/
|
|
109
|
+
lo(i: index): u64_r;
|
|
110
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { index, size, u32, u64_l, u64_r } from "./U64";
|
|
2
|
+
import { U64 } from "./U64";
|
|
3
|
+
export declare const PRIME32_1 = 2654435761;
|
|
4
|
+
export declare const PRIME32_2 = 2246822519;
|
|
5
|
+
export declare const PRIME32_3 = 3266489917;
|
|
6
|
+
export declare const PRIME64_1_0 = 2654435761;
|
|
7
|
+
export declare const PRIME64_1_1 = 2246822535;
|
|
8
|
+
export declare const PRIME64_2_0 = 3266489917;
|
|
9
|
+
export declare const PRIME64_2_1 = 668265295;
|
|
10
|
+
export declare const PRIME64_3_0 = 374761393;
|
|
11
|
+
export declare const PRIME64_3_1 = 2654435833;
|
|
12
|
+
export declare const PRIME64_4_0 = 2246822519;
|
|
13
|
+
export declare const PRIME64_4_1 = 3266489955;
|
|
14
|
+
export declare const PRIME64_5_0 = 668265263;
|
|
15
|
+
export declare const PRIME64_5_1 = 374761413;
|
|
16
|
+
export declare const PRIME_MX1_0 = 374761361;
|
|
17
|
+
export declare const PRIME_MX1_1 = 2654435833;
|
|
18
|
+
export declare const PRIME_MX2_0 = 2679250021;
|
|
19
|
+
export declare const PRIME_MX2_1 = 513335077;
|
|
20
|
+
export declare const DEFAULT_SECRET: Uint8Array;
|
|
21
|
+
/** Slot layout: 0=seed, 1..8=acc[0..7], 9..16=scratch temps */
|
|
22
|
+
export declare const SEED = 0;
|
|
23
|
+
export declare const ACC = 1;
|
|
24
|
+
export declare const T0 = 9;
|
|
25
|
+
export declare const T1 = 10;
|
|
26
|
+
export declare const T2 = 11;
|
|
27
|
+
export declare const T3 = 12;
|
|
28
|
+
export declare const T4 = 13;
|
|
29
|
+
export declare const T5 = 14;
|
|
30
|
+
export declare const T6 = 15;
|
|
31
|
+
export declare const SECRET_LENGTH = 192;
|
|
32
|
+
export declare const STRIPES_PER_BLOCK: number;
|
|
33
|
+
export declare const BLOCK_SIZE: number;
|
|
34
|
+
/**
|
|
35
|
+
* Reads a 32-bit unsigned integer from a byte array in little-endian order.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function readU32LE(b: Uint8Array, offset: index): u32;
|
|
39
|
+
/**
|
|
40
|
+
* Reads a 64-bit unsigned integer from a byte array in little-endian order.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare function readU64LE(b: Uint8Array, offset: index): [u64_l, u64_r];
|
|
44
|
+
/**
|
|
45
|
+
* Reverses the bytes in [x].
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function bswap32(x: u32): u32;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare abstract class Xxh3 {
|
|
53
|
+
protected mem: U64;
|
|
54
|
+
protected seed0: u64_l;
|
|
55
|
+
protected seed1: u64_r;
|
|
56
|
+
protected secret: Uint8Array;
|
|
57
|
+
private dvBuffer;
|
|
58
|
+
private dataView;
|
|
59
|
+
/**
|
|
60
|
+
* Fixed-size buffer (BLOCK_SIZE = 1024 bytes).
|
|
61
|
+
* For inputs lte 240 bytes, holds the entire input for small/medium paths.
|
|
62
|
+
* In streaming mode, buffers the latest block. Complete blocks
|
|
63
|
+
* are processed immediately. The partial tail is kept for finalization
|
|
64
|
+
* during digest.
|
|
65
|
+
*/
|
|
66
|
+
protected blockBuffer: Uint8Array;
|
|
67
|
+
protected bufferIndex: number;
|
|
68
|
+
protected byteCount: number;
|
|
69
|
+
private prevTail;
|
|
70
|
+
private hasPrevTail;
|
|
71
|
+
/**
|
|
72
|
+
* This mode can be entered but not exited.
|
|
73
|
+
*/
|
|
74
|
+
protected streaming: boolean;
|
|
75
|
+
protected constructor(slots: size, seed0?: number, seed1?: number);
|
|
76
|
+
update(chunk: Uint8Array): void;
|
|
77
|
+
reset(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Returns the buffered input for small/medium paths (byteCount lte 240).
|
|
80
|
+
* Only valid when not entered into streaming mode.
|
|
81
|
+
*/
|
|
82
|
+
protected getBufferedInput(): Uint8Array;
|
|
83
|
+
/**
|
|
84
|
+
* Finalizes the large (over 240 bytes) streaming path.
|
|
85
|
+
* Processes the remaining buffered data as the last (partial) block.
|
|
86
|
+
*/
|
|
87
|
+
protected finalizeLargeAccumulators(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Used in step 1: initialize.
|
|
90
|
+
*/
|
|
91
|
+
protected initAccumulators(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Used in step 2: accumulate.
|
|
94
|
+
*/
|
|
95
|
+
protected accumulateStripe(input: Uint8Array, stripeOffset: index, secretOffset: index): void;
|
|
96
|
+
/**
|
|
97
|
+
* Used in step 3: scramble.
|
|
98
|
+
*/
|
|
99
|
+
protected roundScramble(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Used in step 4: merge.
|
|
102
|
+
*/
|
|
103
|
+
protected finalMerge(init0: u64_l, init1: u64_r, secretOffset: index): Uint8Array;
|
|
104
|
+
/**
|
|
105
|
+
* Mixes two 64-bit input lanes with secret-derived keys.
|
|
106
|
+
* Used in step 2: accumulate (medium-length path, 17–240 bytes).
|
|
107
|
+
*/
|
|
108
|
+
protected mix(data: Uint8Array, dataOffset: index, secretOffset: index): index;
|
|
109
|
+
/**
|
|
110
|
+
* avalanche(x): x ^= x >> 37; x *= PRIME_MX1; x ^= x >> 32; Result in `i`.
|
|
111
|
+
* Used in step 5: avalanche.
|
|
112
|
+
*/
|
|
113
|
+
protected avalanche(i: index, v0: u64_l, v1: u64_r): void;
|
|
114
|
+
/**
|
|
115
|
+
* avalanche_XXH64(x): x ^= x>>33; x *= P2; x ^= x>>29; x *= P3; x ^= x>>32; Result in `i`.
|
|
116
|
+
* Used in step 5: avalanche.
|
|
117
|
+
*/
|
|
118
|
+
protected avalanche64(i: index, v0: u64_l, v1: u64_r): void;
|
|
119
|
+
/**
|
|
120
|
+
* Derives a custom secret from the default secret and the seed.
|
|
121
|
+
* Used in step 1: initialize.
|
|
122
|
+
*/
|
|
123
|
+
protected deriveSecret(): Uint8Array;
|
|
124
|
+
/**
|
|
125
|
+
* Returns a cached DataView for the given Uint8Array's buffer.
|
|
126
|
+
* Used in step 2: accumulate.
|
|
127
|
+
*/
|
|
128
|
+
protected view(b: Uint8Array): DataView;
|
|
129
|
+
/**
|
|
130
|
+
* Processes a complete block of BLOCK_SIZE bytes through accumulation and scrambling.
|
|
131
|
+
* Used in step 2: accumulate, and step 3: scramble.
|
|
132
|
+
*/
|
|
133
|
+
private processFullBlock;
|
|
134
|
+
/**
|
|
135
|
+
* Processes the last (possibly partial) block.
|
|
136
|
+
* Used in step 2: accumulate.
|
|
137
|
+
*/
|
|
138
|
+
private processLastBlock;
|
|
139
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Checksum } from "@smithy/types";
|
|
2
|
+
import { Xxh3 } from "../Xxh3";
|
|
3
|
+
/**
|
|
4
|
+
* XXHASH3 128-bit.
|
|
5
|
+
* @see https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md#xxh3-algorithm-overview
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class Xxh3_128 extends Xxh3 implements Checksum {
|
|
9
|
+
readonly digestLength = 16;
|
|
10
|
+
constructor();
|
|
11
|
+
digest(): Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Concatenates two 64-bit slots into a 128-bit result.
|
|
14
|
+
* Used in step 4: merge.
|
|
15
|
+
*/
|
|
16
|
+
private concat;
|
|
17
|
+
/**
|
|
18
|
+
* Handles inputs of 0–16 bytes.
|
|
19
|
+
* Used in steps 2–5: accumulate through avalanche (single-shot path).
|
|
20
|
+
*/
|
|
21
|
+
private digestSmall;
|
|
22
|
+
/**
|
|
23
|
+
* Handles inputs of 17–240 bytes.
|
|
24
|
+
* Used in steps 2–5: accumulate through avalanche (single-shot path).
|
|
25
|
+
*/
|
|
26
|
+
private digestMedium;
|
|
27
|
+
/**
|
|
28
|
+
* Mixes two 16-byte chunks from the input and accumulates into T0 and T1.
|
|
29
|
+
* Used in step 2: accumulate (medium-length path, 17–240 bytes).
|
|
30
|
+
*/
|
|
31
|
+
private mixTwoChunks;
|
|
32
|
+
/**
|
|
33
|
+
* Handles inputs over 240 bytes via streaming accumulators.
|
|
34
|
+
* Used in steps 2–5: accumulate through avalanche (streaming path).
|
|
35
|
+
*/
|
|
36
|
+
private digestLarge;
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Checksum } from "@smithy/types";
|
|
2
|
+
import { Xxh3 } from "../Xxh3";
|
|
3
|
+
/**
|
|
4
|
+
* XXHASH3 64-bit.
|
|
5
|
+
* @see https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md#xxh3-algorithm-overview
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class Xxh3_64 extends Xxh3 implements Checksum {
|
|
9
|
+
readonly digestLength = 8;
|
|
10
|
+
constructor();
|
|
11
|
+
digest(): Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Handles inputs of 0–16 bytes.
|
|
14
|
+
* Used in steps 2–5: accumulate through avalanche (single-shot path).
|
|
15
|
+
*/
|
|
16
|
+
private digestSmall;
|
|
17
|
+
/**
|
|
18
|
+
* Handles inputs of 17–240 bytes.
|
|
19
|
+
* Used in steps 2–5: accumulate through avalanche (single-shot path).
|
|
20
|
+
*/
|
|
21
|
+
private digestMedium;
|
|
22
|
+
/**
|
|
23
|
+
* Handles inputs over 240 bytes via streaming accumulators.
|
|
24
|
+
* Used in steps 2–5: accumulate through avalanche (streaming path).
|
|
25
|
+
*/
|
|
26
|
+
private digestLarge;
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Checksum } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md#xxh64-algorithm-description
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class Xxh64 implements Checksum {
|
|
7
|
+
readonly digestLength = 8;
|
|
8
|
+
private byteCount;
|
|
9
|
+
private mem;
|
|
10
|
+
private stripeBuffer;
|
|
11
|
+
private bufferIndex;
|
|
12
|
+
constructor();
|
|
13
|
+
update(chunk: Uint8Array): void;
|
|
14
|
+
private _update;
|
|
15
|
+
digest(): Promise<Uint8Array>;
|
|
16
|
+
/**
|
|
17
|
+
* Resets accumulators to their initial seeded state.
|
|
18
|
+
* Used in step 1: initialize.
|
|
19
|
+
*/
|
|
20
|
+
reset(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Processes a 32-byte stripe through the four accumulators.
|
|
23
|
+
* Used in step 2: accumulate.
|
|
24
|
+
*/
|
|
25
|
+
private processStripe;
|
|
26
|
+
/**
|
|
27
|
+
* Merges an accumulator into the final hash value.
|
|
28
|
+
* Used in step 3: merge.
|
|
29
|
+
*/
|
|
30
|
+
private mergeAcc;
|
|
31
|
+
/**
|
|
32
|
+
* round: acc += (lane * P2); acc <<<= 31; acc *= P1;
|
|
33
|
+
* Used in step 2: accumulate.
|
|
34
|
+
*/
|
|
35
|
+
private roundAt;
|
|
36
|
+
/**
|
|
37
|
+
* Final bit mixing to ensure good distribution.
|
|
38
|
+
* Used in step 4: avalanche.
|
|
39
|
+
*/
|
|
40
|
+
private avalanche;
|
|
41
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Sha1Js, Sha1Js as Sha1 } from "./sha1/Sha1Js";
|
|
2
2
|
export declare const Sha1Node: symbol;
|
|
3
|
+
export { Sha512WebCrypto, Sha512WebCrypto as Sha512 } from "./sha512/Sha512WebCrypto";
|
|
4
|
+
export { Sha512Js } from "./sha512/Sha512Js";
|
|
3
5
|
export { Sha256, Sha256Js, Sha256Node, Sha256WebCrypto } from "@smithy/core/checksum";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { Sha1Js } from "./sha1/Sha1Js";
|
|
2
2
|
export { Sha1Node, Sha1Node as Sha1 } from "./sha1/Sha1Node";
|
|
3
3
|
export { Sha1WebCrypto } from "./sha1/Sha1WebCrypto";
|
|
4
|
+
export { Sha512 } from "./sha512/Sha512";
|
|
5
|
+
export { Sha512Js } from "./sha512/Sha512Js";
|
|
6
|
+
export { Sha512WebCrypto } from "./sha512/Sha512WebCrypto";
|
|
4
7
|
export { Sha256, Sha256Js, Sha256Node } from "@smithy/core/checksum";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceData } from "@smithy/types";
|
|
2
|
+
import { Sha512Js } from "./Sha512Js";
|
|
3
|
+
export declare class Sha512 extends Sha512Js {
|
|
4
|
+
private native?;
|
|
5
|
+
private readonly nativeSecret?;
|
|
6
|
+
private nativeFinished;
|
|
7
|
+
constructor(secret?: SourceData);
|
|
8
|
+
update(data: Uint8Array): void;
|
|
9
|
+
digest(): Promise<Uint8Array>;
|
|
10
|
+
reset(): void;
|
|
11
|
+
private createNative;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Checksum, SourceData } from "@smithy/types";
|
|
2
|
+
export declare class Sha512Js implements Checksum {
|
|
3
|
+
readonly digestLength = 64;
|
|
4
|
+
private state;
|
|
5
|
+
private w?;
|
|
6
|
+
private buffer;
|
|
7
|
+
private bufferLength;
|
|
8
|
+
private bytesHashed;
|
|
9
|
+
private finished;
|
|
10
|
+
private readonly key?;
|
|
11
|
+
private inner?;
|
|
12
|
+
private outer?;
|
|
13
|
+
constructor(secret?: SourceData);
|
|
14
|
+
update(data: Uint8Array): void;
|
|
15
|
+
digest(): Promise<Uint8Array>;
|
|
16
|
+
reset(): void;
|
|
17
|
+
private initHmac;
|
|
18
|
+
private digestSync;
|
|
19
|
+
private static normalizeKey;
|
|
20
|
+
private hashBuffer;
|
|
21
|
+
private hashBufferWith;
|
|
22
|
+
}
|
package/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512WebCrypto.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Checksum, SourceData } from "@smithy/types";
|
|
2
|
+
export declare class Sha512WebCrypto implements Checksum {
|
|
3
|
+
readonly digestLength: 64;
|
|
4
|
+
private readonly secret?;
|
|
5
|
+
private pending;
|
|
6
|
+
private pendingBytes;
|
|
7
|
+
private fallback?;
|
|
8
|
+
private finished;
|
|
9
|
+
constructor(secret?: SourceData);
|
|
10
|
+
update(data: Uint8Array): void;
|
|
11
|
+
digest(): Promise<Uint8Array>;
|
|
12
|
+
reset(): void;
|
|
13
|
+
private switchToFallback;
|
|
14
|
+
}
|