@pulse-compute/crypto 1.0.0-beta.4 → 1.0.0-beta.6
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 +89 -8
- package/as/digest-text.as.ts +34 -0
- package/as/pulse-hmac-as.ts +7 -1
- package/conformance/digest-text.json +38 -0
- package/conformance/hs256.json +85 -0
- package/dist/contracts.d.ts +34 -12
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +9 -3
- package/dist/contracts.js.map +1 -1
- package/dist/digest.d.ts +14 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +17 -0
- package/dist/digest.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/rsa.d.ts +58 -0
- package/dist/internal/rsa.d.ts.map +1 -0
- package/dist/internal/rsa.js +185 -0
- package/dist/internal/rsa.js.map +1 -0
- package/dist/internal/verification.d.ts +3 -3
- package/dist/internal/verification.d.ts.map +1 -1
- package/dist/internal/verification.js +2 -2
- package/dist/internal/verification.js.map +1 -1
- package/guests/es256-rustcrypto/README.md +43 -0
- package/guests/es256-rustcrypto/build.cjs +297 -0
- package/guests/es256-rustcrypto/prebuilt/es256-verifier.unoptimized.wasm +0 -0
- package/guests/es256-rustcrypto/prebuilt/es256-verifier.wasm +0 -0
- package/guests/es256-rustcrypto/probe/.cargo/config.toml +18 -0
- package/guests/es256-rustcrypto/probe/Cargo.lock +238 -0
- package/guests/es256-rustcrypto/probe/Cargo.toml +26 -0
- package/guests/es256-rustcrypto/probe/README.md +35 -0
- package/guests/es256-rustcrypto/probe/rust-toolchain.toml +5 -0
- package/guests/es256-rustcrypto/probe/src/lib.rs +108 -0
- package/guests/es256-rustcrypto/pulse.guest-unit.json +119 -0
- package/guests/es256-rustcrypto/source/.cargo/config.toml +18 -0
- package/guests/es256-rustcrypto/source/Cargo.lock +265 -0
- package/guests/es256-rustcrypto/source/Cargo.toml +23 -0
- package/guests/es256-rustcrypto/source/README.md +26 -0
- package/guests/es256-rustcrypto/source/bearssl/LICENSE.txt +21 -0
- package/guests/es256-rustcrypto/source/bearssl/UPSTREAM.json +49 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl.h +170 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_aead.h +1059 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_block.h +2618 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_ec.h +883 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_hash.h +1346 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_hmac.h +241 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_kdf.h +185 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_pem.h +294 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_prf.h +150 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_rand.h +397 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_rsa.h +1366 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_ssl.h +4296 -0
- package/guests/es256-rustcrypto/source/bearssl/inc/bearssl_x509.h +1397 -0
- package/guests/es256-rustcrypto/source/bearssl/src/codec/ccopy.c +44 -0
- package/guests/es256-rustcrypto/source/bearssl/src/codec/dec32be.c +38 -0
- package/guests/es256-rustcrypto/source/bearssl/src/codec/enc32be.c +38 -0
- package/guests/es256-rustcrypto/source/bearssl/src/config.h +229 -0
- package/guests/es256-rustcrypto/source/bearssl/src/inner.h +2532 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_add.c +46 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_bitlen.c +44 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_decmod.c +124 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_decode.c +57 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_decred.c +103 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_encode.c +79 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_fmont.c +60 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_iszero.c +39 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_moddiv.c +488 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_modpow.c +65 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_modpow2.c +160 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_montmul.c +93 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_mulacc.c +61 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_muladd.c +157 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_ninv31.c +39 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_reduce.c +66 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_rshift.c +47 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_sub.c +46 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i31_tmont.c +36 -0
- package/guests/es256-rustcrypto/source/bearssl/src/int/i32_div32.c +56 -0
- package/guests/es256-rustcrypto/source/bearssl/src/rsa/rsa_i31_priv.c +203 -0
- package/guests/es256-rustcrypto/source/bearssl/src/rsa/rsa_i31_pub.c +106 -0
- package/guests/es256-rustcrypto/source/bearssl/src/rsa/rsa_pkcs1_sig_pad.c +100 -0
- package/guests/es256-rustcrypto/source/build.rs +38 -0
- package/guests/es256-rustcrypto/source/freestanding/string.h +8 -0
- package/guests/es256-rustcrypto/source/rs256.c +103 -0
- package/guests/es256-rustcrypto/source/rust-toolchain.toml +5 -0
- package/guests/es256-rustcrypto/source/src/lib.rs +308 -0
- package/package.json +22 -4
- package/pulse.package.json +64 -0
- package/pulsewasm.compiler.cjs +89 -0
- package/pulsewasm.manifest.cjs +15 -0
- package/pulsewasm.native.cjs +79 -7
- package/src/provider.cjs +141 -2
- package/src/provider.d.cts +6 -0
package/README.md
CHANGED
|
@@ -2,20 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- pulse-package-status:start -->
|
|
4
4
|
> **Support tier:** Supported provider/extension surface<br>
|
|
5
|
-
> **Audience:** Applications and first-party packages using provider-neutral
|
|
6
|
-
> **Install directly:** Yes, when an application uses
|
|
5
|
+
> **Audience:** Applications and first-party packages using provider-neutral verification and exact-text SHA-256.<br>
|
|
6
|
+
> **Install directly:** Yes, when an application uses verification or digestText directly; JWT applications receive it transitively.<br>
|
|
7
7
|
> **Supported entry points:** `@pulse-compute/crypto`<br>
|
|
8
|
-
> **Stability:** The package root
|
|
8
|
+
> **Stability:** The package root supports bounded verification and request-owned exact-text digests; provider, manifest/compiler and Native integration subpaths remain toolchain-only.<br>
|
|
9
9
|
> **npm:** [`@pulse-compute/crypto`](https://www.npmjs.com/package/@pulse-compute/crypto)<br>
|
|
10
|
-
> **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.
|
|
10
|
+
> **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.6/packages/crypto/)
|
|
11
11
|
>
|
|
12
|
-
> This release-status block is generated from the synchronized `Pulse 1.0.0-beta.
|
|
12
|
+
> This release-status block is generated from the synchronized `Pulse 1.0.0-beta.6` package policy.
|
|
13
13
|
<!-- pulse-package-status:end -->
|
|
14
14
|
|
|
15
|
-
Provider-neutral
|
|
15
|
+
Provider-neutral verification and bounded exact-text SHA-256 for Pulse.
|
|
16
16
|
|
|
17
17
|
This package and `@pulse-compute/jwt` are members of the synchronized
|
|
18
|
-
`1.0.0-beta.
|
|
18
|
+
`1.0.0-beta.6` release catalog.
|
|
19
|
+
|
|
20
|
+
## Exact-text SHA-256
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { crypto } from '@pulse-compute/crypto'
|
|
24
|
+
|
|
25
|
+
const digest = await crypto.digestText(ctx, text)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Select `pulse.crypto: ['SHA-256']`. The current HTTP context owns this effect;
|
|
29
|
+
use a directly awaited local variable or keyed `ctx.parallel` member.
|
|
30
|
+
Success is `{ status: 'ok', sha256, byteLength }`: 64 lowercase hex characters
|
|
31
|
+
and the exact UTF-8 length. The public `DIGEST_TEXT_MAX_BYTES` is 2097152, empty
|
|
32
|
+
input is accepted, and unpaired surrogates are rejected without replacement.
|
|
33
|
+
No normalization, parsing, BOM stripping, or newline conversion occurs.
|
|
34
|
+
Failures are `{ status: 'failed', reason }`, where reason is `invalid-text`,
|
|
35
|
+
`too-large`, `unavailable`, or `realization-failure`; cancellation terminates
|
|
36
|
+
the invocation. The named `digestText` export has the same contract.
|
|
37
|
+
|
|
38
|
+
Node/Fastly Native reuse the selected Crypto SHA-256 guest source. Node/Fastly
|
|
39
|
+
JavaScript use selected Web Crypto. Neither falls back. This bound matches
|
|
40
|
+
current S3 text capacity and leaves larger Catalog envelopes for capacity work.
|
|
41
|
+
See the [exact-text digest contract](https://pulsecompute.io/v1.0.0-beta.6/packages/crypto/#exact-text-digest).
|
|
19
42
|
|
|
20
43
|
## Verification contract
|
|
21
44
|
|
|
@@ -132,9 +155,67 @@ deployment.
|
|
|
132
155
|
S3 uses Crypto-owned SHA-256 and HMAC-SHA256 byte outputs. Native composes the
|
|
133
156
|
existing guest-source unit; Node JavaScript explicitly binds Web Crypto through
|
|
134
157
|
`@pulse-compute/crypto/provider`. The trusted seam snapshots Uint8Array input,
|
|
135
|
-
allows at most
|
|
158
|
+
allows at most 2097152 SHA-256 data bytes, 32768 HMAC data bytes and 8192 HMAC
|
|
159
|
+
key bytes, returns exactly 32 bytes,
|
|
136
160
|
and wipes input staging on success or failure. It rejects unavailable selected
|
|
137
161
|
primitives and does not fall back. Empty HMAC keys use the equivalent padded
|
|
138
162
|
zero block required by HMAC, preserving Native semantics despite Web Crypto's
|
|
139
163
|
zero-length import restriction. This provider seam does not add an author-facing
|
|
140
164
|
signing API or change JWT key limits.
|
|
165
|
+
|
|
166
|
+
Large hashes use a separate lazy 2,097,184-byte Native staging frame; small
|
|
167
|
+
hashes and HMAC keep the 40,992-byte frame. Primary-memory Native digest/S3
|
|
168
|
+
modules have a 256 MiB Wasm maximum. Fixed-memory linked guests retain their
|
|
169
|
+
separate ABI and do not establish the 2 MiB text capacity profile.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## RS256 signature contract
|
|
173
|
+
|
|
174
|
+
`crypto.signature.verify` accepts `algorithm: 'RS256'` and a
|
|
175
|
+
`rsa-public-key-bytes` key. `normalizeRsaPublicKey({ n, e })` converts public
|
|
176
|
+
JWK integers into that representation; `normalizeRs256JoseVerifyRequest`
|
|
177
|
+
also decodes the canonical, fixed-width JOSE signature. JWT owns JWK metadata
|
|
178
|
+
and selection policy. No generic public signing API is introduced.
|
|
179
|
+
|
|
180
|
+
The normalized key is a little-endian 32-bit modulus byte length, the unsigned
|
|
181
|
+
big-endian modulus, and a four-byte big-endian public exponent. Supported
|
|
182
|
+
lengths are 256, 384, and 512 bytes; the modulus has its high bit set and is
|
|
183
|
+
odd. Exponents are odd integers in `[3, 4294967295]`. Signature width equals
|
|
184
|
+
modulus width, including any leading zero signature bytes. Data is at most
|
|
185
|
+
12288 bytes. Verification returns the existing closed status taxonomy.
|
|
186
|
+
|
|
187
|
+
The exact Native selection is `guest-linked:pulse-rs256-bearssl-i31` with
|
|
188
|
+
`bearssl.0.6.rsa-i31.sha256.v1`. It shares the pinned ES256/RS256 prebuilt and
|
|
189
|
+
fixed 2 MiB memory with ES256. The private signing adapter accepts normalized
|
|
190
|
+
RSA/CRT bytes, validates their consistency, and checks every resulting
|
|
191
|
+
signature by public exponentiation before release. The caller erases its
|
|
192
|
+
16640-byte invocation frame and the borrowed 64 KiB guest stack on return.
|
|
193
|
+
The Node wrapper also clears both regions on a trap; a Fastly Native trap
|
|
194
|
+
aborts execution before in-Wasm cleanup can run. The guest has no retained
|
|
195
|
+
key state, entropy imports, allocation, or host callbacks. PKCS#1 v1.5
|
|
196
|
+
signing is deterministic and needs no nonce.
|
|
197
|
+
|
|
198
|
+
BearSSL `i31` uses constant-time arithmetic rather than RSA blinding. Its
|
|
199
|
+
security assumptions include constant-time integer multiplication and a
|
|
200
|
+
compiler/engine that preserves the intended data-independent execution.
|
|
201
|
+
This is not a formal timing proof for every Wasm engine or CPU. The pinned
|
|
202
|
+
upstream source, license, archive hash, per-file hashes, compiler versions,
|
|
203
|
+
and reproducible build command ship with the guest. The historical guest
|
|
204
|
+
path and module name remain for compatibility; its ABI is now
|
|
205
|
+
`pulse.crypto.es256-rs256.verify-and-sign.v3`.
|
|
206
|
+
|
|
207
|
+
JavaScript explicitly selects `RSASSA-PKCS1-v1_5` with `SHA-256` in Web Crypto
|
|
208
|
+
and independently verifies signing output. Redundant private-field import
|
|
209
|
+
checks use JavaScript BigInt, which is not constant time; private
|
|
210
|
+
exponentiation and blinding belong to the selected Web Crypto runtime.
|
|
211
|
+
Immutable JWK strings and runtime-owned key objects cannot be explicitly
|
|
212
|
+
erased by Pulse. The provider retains its existing cancellation and
|
|
213
|
+
redaction boundaries.
|
|
214
|
+
|
|
215
|
+
The combined prebuilt is 36378 bytes. The development corpus observed 6324
|
|
216
|
+
bytes of guest stack writes within the reserved 65536 bytes. Local warmed
|
|
217
|
+
4096-bit operations took roughly 43 ms to sign and 1.5 ms to verify; these
|
|
218
|
+
are local Node Wasm observations, not performance guarantees or Fastly
|
|
219
|
+
measurements. `crypto-rs256` regenerates the observations and tests independent
|
|
220
|
+
interoperability, malformed PKCS#1 encodings, CRT corruption, frame bounds,
|
|
221
|
+
and cleanup. `jwt-rs256` covers the provider and CLI paths.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Crypto-owned text framing over the existing SHA-256 implementation.
|
|
2
|
+
class __PulseTextDigestResult {
|
|
3
|
+
status: string = 'failed'
|
|
4
|
+
reason: string = ''
|
|
5
|
+
sha256: string = ''
|
|
6
|
+
byteLength: i32 = 0
|
|
7
|
+
}
|
|
8
|
+
function __pulse_crypto_digest_text(text: string | null): __PulseTextDigestResult {
|
|
9
|
+
const result = new __PulseTextDigestResult()
|
|
10
|
+
if (text === null) { result.reason = 'invalid-text'; return result }
|
|
11
|
+
if (text.length > 2097152) { result.reason = 'too-large'; return result }
|
|
12
|
+
let length = 0
|
|
13
|
+
for (let i = 0; i < text.length; i++) {
|
|
14
|
+
const c = text.charCodeAt(i)
|
|
15
|
+
if (c >= 0xd800 && c <= 0xdbff) {
|
|
16
|
+
i += 1
|
|
17
|
+
if (i >= text.length) { result.reason = 'invalid-text'; return result }
|
|
18
|
+
const low = text.charCodeAt(i)
|
|
19
|
+
if (low < 0xdc00 || low > 0xdfff) { result.reason = 'invalid-text'; return result }
|
|
20
|
+
length += 4
|
|
21
|
+
} else if (c >= 0xdc00 && c <= 0xdfff) { result.reason = 'invalid-text'; return result }
|
|
22
|
+
else length += c < 0x80 ? 1 : c < 0x800 ? 2 : 3
|
|
23
|
+
}
|
|
24
|
+
if (length > 2097152) { result.reason = 'too-large'; return result }
|
|
25
|
+
const data = Uint8Array.wrap(String.UTF8.encode(text)), digest = new Uint8Array(32)
|
|
26
|
+
const code = pulse_crypto_sha256_bytes_v1(data.dataStart, data.length, digest.dataStart, 32)
|
|
27
|
+
data.fill(0)
|
|
28
|
+
if (code != 1) { digest.fill(0); result.reason = 'realization-failure'; return result }
|
|
29
|
+
const alphabet = '0123456789abcdef'
|
|
30
|
+
for (let i = 0; i < 32; i++) result.sha256 += alphabet.charAt(digest[i] >> 4) + alphabet.charAt(digest[i] & 15)
|
|
31
|
+
digest.fill(0)
|
|
32
|
+
result.status = 'ok'; result.byteLength = length
|
|
33
|
+
return result
|
|
34
|
+
}
|
package/as/pulse-hmac-as.ts
CHANGED
|
@@ -318,12 +318,18 @@ export function pulse_crypto_hs256_verify(
|
|
|
318
318
|
// by Crypto; host callers may stage synchronously, copy the output, then wipe.
|
|
319
319
|
// It does not grow Wasm memory per operation or overlap allocator-owned memory.
|
|
320
320
|
const __pulse_crypto_bytes_frame = new Uint8Array(8192 + 32768 + 32)
|
|
321
|
+
// Allocate the larger digest-only frame only when a host stages a large hash.
|
|
322
|
+
// Small digest/MAC callers and fixed-memory JWT guests keep the original frame.
|
|
323
|
+
@lazy const __pulse_crypto_digest_frame = new Uint8Array(2097152 + 32)
|
|
324
|
+
export function pulse_crypto_digest_frame_v1(): i32 {
|
|
325
|
+
return <i32>__pulse_crypto_digest_frame.dataStart
|
|
326
|
+
}
|
|
321
327
|
export function pulse_crypto_bytes_frame_v1(): i32 {
|
|
322
328
|
return <i32>__pulse_crypto_bytes_frame.dataStart
|
|
323
329
|
}
|
|
324
330
|
|
|
325
331
|
export function pulse_crypto_sha256_bytes_v1(dataPointer: i32, dataLength: i32, outputPointer: i32, outputLength: i32): i32 {
|
|
326
|
-
if (dataLength < 0 || dataLength >
|
|
332
|
+
if (dataLength < 0 || dataLength > 2097152 || outputLength != 32
|
|
327
333
|
|| !__pulse_crypto_memory_range_valid(dataPointer, dataLength)
|
|
328
334
|
|| !__pulse_crypto_memory_range_valid(outputPointer, outputLength)) return __PULSE_CRYPTO_INVALID_INPUT
|
|
329
335
|
const digest = __pulse_crypto_sha256_memory(<usize><u32>dataPointer, dataLength)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "pulse.crypto-text-digest-corpus.v1",
|
|
3
|
+
"algorithm": "SHA-256",
|
|
4
|
+
"encoding": "lowercase-hex",
|
|
5
|
+
"maxUtf8Bytes": 2097152,
|
|
6
|
+
"vectors": [
|
|
7
|
+
{
|
|
8
|
+
"text": "",
|
|
9
|
+
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
10
|
+
"byteLength": 0
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"text": "abc",
|
|
14
|
+
"sha256": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
|
|
15
|
+
"byteLength": 3
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"text": "\ufeff\u00e9\ud83d\ude00\u0000\r\n",
|
|
19
|
+
"sha256": "894e231659c59a0e7c35180fbca175d0fb836eb20485a8d0dd02bf5ff8c2a4e7",
|
|
20
|
+
"byteLength": 12
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"text": "\u00e9",
|
|
24
|
+
"sha256": "4a99557e4033c3539de2eb65472017cad5f9557f7a0625a09f1c3f6e2ba69c4c",
|
|
25
|
+
"byteLength": 2
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"text": "e\u0301",
|
|
29
|
+
"sha256": "bf12767b0f2a56b2190075bae8169f656e3ce8d6357d4aff184bc6c7ea48f9f6",
|
|
30
|
+
"byteLength": 3
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"text": "{ \"b\":2, \"a\":1 }",
|
|
34
|
+
"sha256": "a782da44b228c14de003efcebc359fbe0a5bc35d90d5da70513e54e25fa5428a",
|
|
35
|
+
"byteLength": 16
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "pulse.crypto.hs256-conformance.v2",
|
|
3
|
+
"sources": {
|
|
4
|
+
"sha256": "NIST FIPS 180-4",
|
|
5
|
+
"hmac": "RFC 2104",
|
|
6
|
+
"vectors": "RFC 4231 test cases 6 and 7"
|
|
7
|
+
},
|
|
8
|
+
"resultStatuses": [
|
|
9
|
+
"valid",
|
|
10
|
+
"invalid-authenticator",
|
|
11
|
+
"invalid-key",
|
|
12
|
+
"invalid-input",
|
|
13
|
+
"realization-failure"
|
|
14
|
+
],
|
|
15
|
+
"resourceLimits": {
|
|
16
|
+
"hmacKeyBytesMinimum": 32,
|
|
17
|
+
"hmacKeyBytesMaximum": 4096,
|
|
18
|
+
"macDataBytesMaximum": 1048576,
|
|
19
|
+
"hs256TagBytes": 32
|
|
20
|
+
},
|
|
21
|
+
"publishedVectors": [
|
|
22
|
+
{
|
|
23
|
+
"id": "rfc4231-6",
|
|
24
|
+
"keyByte": 170,
|
|
25
|
+
"keyLength": 131,
|
|
26
|
+
"dataHex": "54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374",
|
|
27
|
+
"tagHex": "60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "rfc4231-7",
|
|
31
|
+
"keyByte": 170,
|
|
32
|
+
"keyLength": 131,
|
|
33
|
+
"dataHex": "5468697320697320612074657374207573696e672061206c6172676572207468616e20626c6f636b2d73697a65206b657920616e642061206c6172676572207468616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565647320746f20626520686173686564206265666f7265206265696e6720757365642062792074686520484d414320616c676f726974686d2e",
|
|
34
|
+
"tagHex": "9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"boundaryVectors": {
|
|
38
|
+
"emptyData": {
|
|
39
|
+
"keyByte": 42,
|
|
40
|
+
"keyLength": 32,
|
|
41
|
+
"dataLength": 0,
|
|
42
|
+
"dataByte": 0,
|
|
43
|
+
"tagHex": "25e570b039a294705747f0783f32e9b538be395f8713fbcbf346844d84bc78ad"
|
|
44
|
+
},
|
|
45
|
+
"maximumData": {
|
|
46
|
+
"keyByte": 42,
|
|
47
|
+
"keyLength": 32,
|
|
48
|
+
"dataLength": 1048576,
|
|
49
|
+
"dataByte": 165,
|
|
50
|
+
"tagHex": "c897712d87b7a5649ec1115c6d7461372ff21fdebdc8711b23ddefc0a52e74a3"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"verificationCases": [
|
|
54
|
+
{ "id": "valid-tag", "fixture": "rfc4231-6", "mutation": "none", "expected": "valid" },
|
|
55
|
+
{ "id": "invalid-tag", "fixture": "rfc4231-6", "mutation": "zero-tag", "expected": "invalid-authenticator" },
|
|
56
|
+
{ "id": "first-byte-mismatch", "fixture": "rfc4231-6", "mutation": "tag-byte-0", "expected": "invalid-authenticator" },
|
|
57
|
+
{ "id": "middle-byte-mismatch", "fixture": "rfc4231-6", "mutation": "tag-byte-15", "expected": "invalid-authenticator" },
|
|
58
|
+
{ "id": "last-byte-mismatch", "fixture": "rfc4231-6", "mutation": "tag-byte-31", "expected": "invalid-authenticator" },
|
|
59
|
+
{ "id": "altered-data", "fixture": "rfc4231-6", "mutation": "data-byte-0", "expected": "invalid-authenticator" },
|
|
60
|
+
{ "id": "wrong-key", "fixture": "rfc4231-6", "mutation": "key-byte-0", "expected": "invalid-authenticator" },
|
|
61
|
+
{ "id": "undersized-key", "fixture": "rfc4231-6", "mutation": "key-length-31", "expected": "invalid-key" },
|
|
62
|
+
{ "id": "malformed-key", "fixture": "rfc4231-6", "mutation": "malformed-key", "expected": "invalid-key" },
|
|
63
|
+
{ "id": "empty-data", "fixture": "empty-data", "mutation": "none", "expected": "valid" },
|
|
64
|
+
{ "id": "bounded-maximum-data", "fixture": "maximum-data", "mutation": "none", "expected": "valid" },
|
|
65
|
+
{ "id": "over-limit-data", "fixture": "maximum-data", "mutation": "data-over-limit", "expected": "invalid-input" },
|
|
66
|
+
{ "id": "malformed-tag", "fixture": "rfc4231-6", "mutation": "malformed-tag", "expected": "invalid-input" },
|
|
67
|
+
{ "id": "wrong-length-tag", "fixture": "rfc4231-6", "mutation": "tag-length-31", "expected": "invalid-input" }
|
|
68
|
+
],
|
|
69
|
+
"configurationCases": [
|
|
70
|
+
"inherited-global-crypto",
|
|
71
|
+
"named-profile-replacement",
|
|
72
|
+
"no-array-merging",
|
|
73
|
+
"no-object-merging",
|
|
74
|
+
"empty-array",
|
|
75
|
+
"empty-object",
|
|
76
|
+
"duplicate-array-entry",
|
|
77
|
+
"unknown-key",
|
|
78
|
+
"unknown-algorithm",
|
|
79
|
+
"unknown-realization",
|
|
80
|
+
"profile-missing-hs256",
|
|
81
|
+
"target-without-hs256",
|
|
82
|
+
"unavailable-exact-realization-pin",
|
|
83
|
+
"no-fallback-after-realization-failure"
|
|
84
|
+
]
|
|
85
|
+
}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -6,13 +6,12 @@ export declare const CRYPTO_ES256_RUNTIME_BUILTIN_IMPLEMENTATION: "webcrypto.sub
|
|
|
6
6
|
export declare const CRYPTO_ES256_GUEST_LINKED_REALIZATION: "guest-linked:pulse-es256-rustcrypto-p256";
|
|
7
7
|
export declare const CRYPTO_ES256_GUEST_LINKED_IMPLEMENTATION: "rustcrypto.p256-0.13.2.ecdsa-0.16.9.sha2-0.10.9.v1";
|
|
8
8
|
/**
|
|
9
|
-
* Executable algorithms
|
|
10
|
-
* contracts. G3, not G0, owns activation of ES256.
|
|
9
|
+
* Executable verification algorithms. Signature keys remain algorithm-bound.
|
|
11
10
|
*/
|
|
12
|
-
export declare const CRYPTO_ALGORITHMS: readonly ["HS256", "ES256"];
|
|
11
|
+
export declare const CRYPTO_ALGORITHMS: readonly ["HS256", "ES256", "RS256"];
|
|
13
12
|
export type CryptoAlgorithm = typeof CRYPTO_ALGORITHMS[number];
|
|
14
13
|
export type MacAlgorithm = 'HS256';
|
|
15
|
-
export type SignatureAlgorithm = 'ES256';
|
|
14
|
+
export type SignatureAlgorithm = 'ES256' | 'RS256';
|
|
16
15
|
export declare const CRYPTO_VERIFICATION_STATUSES: readonly ["valid", "invalid-authenticator", "invalid-key", "invalid-input", "realization-failure"];
|
|
17
16
|
export type CryptoVerificationStatus = typeof CRYPTO_VERIFICATION_STATUSES[number];
|
|
18
17
|
export type CryptoVerificationResult = {
|
|
@@ -50,14 +49,18 @@ export interface P256PublicKeyBytes {
|
|
|
50
49
|
/** Exactly 64 bytes: 32-byte big-endian x followed by 32-byte big-endian y. */
|
|
51
50
|
readonly bytes: Uint8Array;
|
|
52
51
|
}
|
|
53
|
-
export
|
|
54
|
-
readonly algorithm: SignatureAlgorithm;
|
|
55
|
-
readonly key: P256PublicKeyBytes;
|
|
52
|
+
export type SignatureVerifyRequest = Readonly<{
|
|
56
53
|
/** Exact original signing bytes; never a reserialized JWT representation. */
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
}
|
|
54
|
+
data: Uint8Array;
|
|
55
|
+
/** JOSE P-256 r||s, or one RSA modulus-width octet string. */
|
|
56
|
+
signature: Uint8Array;
|
|
57
|
+
}> & (Readonly<{
|
|
58
|
+
algorithm: 'ES256';
|
|
59
|
+
key: P256PublicKeyBytes;
|
|
60
|
+
}> | Readonly<{
|
|
61
|
+
algorithm: 'RS256';
|
|
62
|
+
key: RsaPublicKeyBytes;
|
|
63
|
+
}>);
|
|
61
64
|
/**
|
|
62
65
|
* Crypto-owned adapter input for the one JOSE representation accepted by the
|
|
63
66
|
* JWT composition. JWT has already validated the public JWK policy; crypto
|
|
@@ -83,6 +86,9 @@ export declare const CRYPTO_RESOURCE_LIMITS: Readonly<{
|
|
|
83
86
|
readonly es256PublicKeyBytes: 64;
|
|
84
87
|
readonly es256SignatureBytes: 64;
|
|
85
88
|
readonly es256SigningInputBytesMaximum: 16340;
|
|
89
|
+
readonly rs256ModulusBytes: readonly [256, 384, 512];
|
|
90
|
+
readonly rs256PublicExponentMaximum: 4294967295;
|
|
91
|
+
readonly rs256SigningInputBytesMaximum: 12288;
|
|
86
92
|
}>;
|
|
87
93
|
export declare const CRYPTO_ES256_CONTRACT: Readonly<{
|
|
88
94
|
readonly version: "pulse.crypto.es256-verification.v1";
|
|
@@ -120,7 +126,7 @@ export declare const CRYPTO_ES256_CONTRACT: Readonly<{
|
|
|
120
126
|
unitId: "pulse.crypto.es256.rustcrypto-p256.v1";
|
|
121
127
|
module: "pulse_crypto_es256";
|
|
122
128
|
owner: "@pulse-compute/crypto";
|
|
123
|
-
abi: "pulse.crypto.es256.verify.
|
|
129
|
+
abi: "pulse.crypto.es256-rs256.verify-and-sign.v3";
|
|
124
130
|
export: Readonly<{
|
|
125
131
|
name: "pulse_crypto_es256_verify";
|
|
126
132
|
parameters: readonly ["i32", "i32"];
|
|
@@ -195,4 +201,20 @@ export declare const CRYPTO_ES256_CONTRACT: Readonly<{
|
|
|
195
201
|
}>;
|
|
196
202
|
readonly automaticFallback: false;
|
|
197
203
|
}>;
|
|
204
|
+
export interface RsaPublicKeyBytes {
|
|
205
|
+
readonly type: 'rsa-public-key-bytes';
|
|
206
|
+
/** LE32 modulus byte length, big-endian modulus, four-byte public exponent. */
|
|
207
|
+
readonly bytes: Uint8Array;
|
|
208
|
+
}
|
|
209
|
+
export interface Rs256JoseVerifyInput {
|
|
210
|
+
readonly key: Readonly<{
|
|
211
|
+
n: string;
|
|
212
|
+
e: string;
|
|
213
|
+
}>;
|
|
214
|
+
readonly data: Uint8Array;
|
|
215
|
+
readonly signature: string;
|
|
216
|
+
}
|
|
217
|
+
export declare const CRYPTO_RS256_GUEST_LINKED_REALIZATION: "guest-linked:pulse-rs256-bearssl-i31";
|
|
218
|
+
export declare const CRYPTO_RS256_GUEST_LINKED_IMPLEMENTATION: "bearssl.0.6.rsa-i31.sha256.v1";
|
|
219
|
+
export declare const CRYPTO_RS256_RUNTIME_BUILTIN_IMPLEMENTATION: "webcrypto.subtle.rsassa-pkcs1-v1_5-sha-256.v1";
|
|
198
220
|
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,EAAG,8BAAuC,CAAC;AAC/E,eAAO,MAAM,qCAAqC,EAChD,kCAA2C,CAAC;AAC9C,eAAO,MAAM,kCAAkC,EAC7C,kBAA2B,CAAC;AAC9B,eAAO,MAAM,6BAA6B,EACxC,oCAA6C,CAAC;AAChD,eAAO,MAAM,2CAA2C,EACtD,wCAAiD,CAAC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ACpB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;EAWxB,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoHvB,CAAC;AAEZ,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AACD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AACD,eAAO,MAAM,qCAAqC,EAAG,sCAA+C,CAAC;AACrG,eAAO,MAAM,wCAAwC,EAAG,+BAAwC,CAAC;AACjG,eAAO,MAAM,2CAA2C,EAAG,+CAAwD,CAAC"}
|
package/dist/contracts.js
CHANGED
|
@@ -6,12 +6,12 @@ export const CRYPTO_ES256_RUNTIME_BUILTIN_IMPLEMENTATION = 'webcrypto.subtle.ecd
|
|
|
6
6
|
export const CRYPTO_ES256_GUEST_LINKED_REALIZATION = 'guest-linked:pulse-es256-rustcrypto-p256';
|
|
7
7
|
export const CRYPTO_ES256_GUEST_LINKED_IMPLEMENTATION = 'rustcrypto.p256-0.13.2.ecdsa-0.16.9.sha2-0.10.9.v1';
|
|
8
8
|
/**
|
|
9
|
-
* Executable algorithms
|
|
10
|
-
* contracts. G3, not G0, owns activation of ES256.
|
|
9
|
+
* Executable verification algorithms. Signature keys remain algorithm-bound.
|
|
11
10
|
*/
|
|
12
11
|
export const CRYPTO_ALGORITHMS = Object.freeze([
|
|
13
12
|
'HS256',
|
|
14
13
|
'ES256',
|
|
14
|
+
'RS256',
|
|
15
15
|
]);
|
|
16
16
|
export const CRYPTO_VERIFICATION_STATUSES = Object.freeze([
|
|
17
17
|
'valid',
|
|
@@ -28,6 +28,9 @@ export const CRYPTO_RESOURCE_LIMITS = Object.freeze({
|
|
|
28
28
|
es256PublicKeyBytes: 64,
|
|
29
29
|
es256SignatureBytes: 64,
|
|
30
30
|
es256SigningInputBytesMaximum: 16_340,
|
|
31
|
+
rs256ModulusBytes: Object.freeze([256, 384, 512]),
|
|
32
|
+
rs256PublicExponentMaximum: 0xffffffff,
|
|
33
|
+
rs256SigningInputBytesMaximum: 12_288,
|
|
31
34
|
});
|
|
32
35
|
export const CRYPTO_ES256_CONTRACT = Object.freeze({
|
|
33
36
|
version: CRYPTO_ES256_CONTRACT_VERSION,
|
|
@@ -71,7 +74,7 @@ export const CRYPTO_ES256_CONTRACT = Object.freeze({
|
|
|
71
74
|
unitId: 'pulse.crypto.es256.rustcrypto-p256.v1',
|
|
72
75
|
module: 'pulse_crypto_es256',
|
|
73
76
|
owner: '@pulse-compute/crypto',
|
|
74
|
-
abi: 'pulse.crypto.es256.verify.
|
|
77
|
+
abi: 'pulse.crypto.es256-rs256.verify-and-sign.v3',
|
|
75
78
|
export: Object.freeze({
|
|
76
79
|
name: 'pulse_crypto_es256_verify',
|
|
77
80
|
parameters: Object.freeze(['i32', 'i32']),
|
|
@@ -146,4 +149,7 @@ export const CRYPTO_ES256_CONTRACT = Object.freeze({
|
|
|
146
149
|
}),
|
|
147
150
|
automaticFallback: false,
|
|
148
151
|
});
|
|
152
|
+
export const CRYPTO_RS256_GUEST_LINKED_REALIZATION = 'guest-linked:pulse-rs256-bearssl-i31';
|
|
153
|
+
export const CRYPTO_RS256_GUEST_LINKED_IMPLEMENTATION = 'bearssl.0.6.rsa-i31.sha256.v1';
|
|
154
|
+
export const CRYPTO_RS256_RUNTIME_BUILTIN_IMPLEMENTATION = 'webcrypto.subtle.rsassa-pkcs1-v1_5-sha-256.v1';
|
|
149
155
|
//# sourceMappingURL=contracts.js.map
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAAuC,CAAC;AAC/E,MAAM,CAAC,MAAM,qCAAqC,GAChD,kCAA2C,CAAC;AAC9C,MAAM,CAAC,MAAM,kCAAkC,GAC7C,kBAA2B,CAAC;AAC9B,MAAM,CAAC,MAAM,6BAA6B,GACxC,oCAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,2CAA2C,GACtD,wCAAiD,CAAC;AACpD,MAAM,CAAC,MAAM,qCAAqC,GAChD,0CAAmD,CAAC;AACtD,MAAM,CAAC,MAAM,wCAAwC,GACnD,oDAA6D,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAAuC,CAAC;AAC/E,MAAM,CAAC,MAAM,qCAAqC,GAChD,kCAA2C,CAAC;AAC9C,MAAM,CAAC,MAAM,kCAAkC,GAC7C,kBAA2B,CAAC;AAC9B,MAAM,CAAC,MAAM,6BAA6B,GACxC,oCAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,2CAA2C,GACtD,wCAAiD,CAAC;AACpD,MAAM,CAAC,MAAM,qCAAqC,GAChD,0CAAmD,CAAC;AACtD,MAAM,CAAC,MAAM,wCAAwC,GACnD,oDAA6D,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,OAAO;IACP,OAAO;IACP,OAAO;CACC,CAAC,CAAC;AAMZ,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,OAAO;IACP,uBAAuB;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AwC,GAAG,+BAAwC,CAAC;AACjG,MAAM,CAAC,MAAM,2CAA2C,GAAG,+CAAwD,CAAC"}
|
package/dist/digest.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PulseContext, PulseParallelEffect } from '@pulse-compute/runtime';
|
|
2
|
+
/** Exact UTF-8 text bound, independent of HMAC and JWT limits. */
|
|
3
|
+
export declare const DIGEST_TEXT_MAX_BYTES: 2097152;
|
|
4
|
+
export type TextDigestResult = {
|
|
5
|
+
readonly status: 'ok';
|
|
6
|
+
readonly sha256: string;
|
|
7
|
+
readonly byteLength: number;
|
|
8
|
+
} | {
|
|
9
|
+
readonly status: 'failed';
|
|
10
|
+
readonly reason: 'invalid-text' | 'too-large' | 'unavailable' | 'realization-failure';
|
|
11
|
+
};
|
|
12
|
+
/** Hash exact, well-formed text without normalization, parsing or uploading. */
|
|
13
|
+
export declare function digestText(ctx: PulseContext, text: string): PulseParallelEffect<TextDigestResult>;
|
|
14
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAIhF,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,EAAG,OAAgB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,GAAG,aAAa,GAAG,qBAAqB,CAAA;CAAE,CAAC;AAOzH,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAMjG"}
|
package/dist/digest.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import packageRuntime from '@pulse-compute/runtime/package';
|
|
2
|
+
import digestProvider from '../src/provider.cjs';
|
|
3
|
+
/** Exact UTF-8 text bound, independent of HMAC and JWT limits. */
|
|
4
|
+
export const DIGEST_TEXT_MAX_BYTES = 2097152;
|
|
5
|
+
const runtime = packageRuntime.createPackageRuntime({
|
|
6
|
+
package: '@pulse-compute/crypto', contractId: 'pulse.crypto', providerKind: 'crypto',
|
|
7
|
+
operations: { digestText: { kind: 'crypto.digestText', capability: 'crypto.digestText', result: 'text-digest-result' } },
|
|
8
|
+
});
|
|
9
|
+
/** Hash exact, well-formed text without normalization, parsing or uploading. */
|
|
10
|
+
export function digestText(ctx, text) {
|
|
11
|
+
// Preserve the over-limit signal without copying unbounded text into the
|
|
12
|
+
// shared effect envelope. This prefix is itself over the code-unit bound
|
|
13
|
+
// and is rejected before UTF-8 encoding or hashing on every realization.
|
|
14
|
+
const boundedText = typeof text === 'string' ? text.slice(0, DIGEST_TEXT_MAX_BYTES + 1) : null;
|
|
15
|
+
return runtime.effect(ctx, 'digestText', { text: boundedText }, digestProvider.normalizeTextDigestResult);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,kEAAkE;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAgB,CAAC;AAKtD,MAAM,OAAO,GAAG,cAAc,CAAC,oBAAoB,CAAC;IAClD,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ;IACpF,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE;CAChH,CAAC,CAAC;AAEZ,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,GAAiB,EAAE,IAAY;IACxD,yEAAyE;IACzE,yEAAyE;IACzE,yEAAyE;IACzE,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/F,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,cAAc,CAAC,yBAAyB,CAAC,CAAC;AAC5G,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { normalizeRsaPublicKey, normalizeRs256JoseVerifyRequest } from './internal/rsa.js';
|
|
2
|
+
export type { RsaPublicKeyBytes, Rs256JoseVerifyInput } from './contracts.js';
|
|
3
|
+
export { CRYPTO_RS256_GUEST_LINKED_REALIZATION, CRYPTO_RS256_GUEST_LINKED_IMPLEMENTATION, CRYPTO_RS256_RUNTIME_BUILTIN_IMPLEMENTATION } from './contracts.js';
|
|
1
4
|
import { CRYPTO_ALGORITHMS, CRYPTO_CONTRACT_VERSION, CRYPTO_ES256_CONTRACT, CRYPTO_ES256_CONTRACT_VERSION, CRYPTO_ES256_GUEST_LINKED_IMPLEMENTATION, CRYPTO_ES256_GUEST_LINKED_REALIZATION, CRYPTO_ES256_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_GUEST_SOURCE_IMPLEMENTATION, CRYPTO_RESOURCE_LIMITS, CRYPTO_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_VERIFICATION_STATUSES, type CryptoAlgorithm, type CryptoVerificationResult, type CryptoVerificationStatus, type Es256JoseVerifyInput, type HmacKeyBytes, type HmacVerificationKey, type MacAlgorithm, type MacVerifyRequest, type P256PublicKeyBytes, type P256PublicKeyCoordinates, type SignatureAlgorithm, type SignatureVerifyRequest } from './contracts.js';
|
|
2
5
|
import { normalizeEs256JoseVerifyRequest, normalizeP256PublicKeyCoordinates } from './internal/verification.js';
|
|
3
6
|
export { CRYPTO_ALGORITHMS, CRYPTO_CONTRACT_VERSION, CRYPTO_ES256_CONTRACT, CRYPTO_ES256_CONTRACT_VERSION, CRYPTO_ES256_GUEST_LINKED_IMPLEMENTATION, CRYPTO_ES256_GUEST_LINKED_REALIZATION, CRYPTO_ES256_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_GUEST_SOURCE_IMPLEMENTATION, CRYPTO_RESOURCE_LIMITS, CRYPTO_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_VERIFICATION_STATUSES, };
|
|
@@ -11,7 +14,10 @@ export declare const mac: Readonly<{
|
|
|
11
14
|
export declare const signature: Readonly<{
|
|
12
15
|
verify: typeof verifySignature;
|
|
13
16
|
}>;
|
|
17
|
+
export { DIGEST_TEXT_MAX_BYTES, digestText, type TextDigestResult } from './digest.js';
|
|
18
|
+
import { digestText } from './digest.js';
|
|
14
19
|
export declare const crypto: Readonly<{
|
|
20
|
+
digestText: typeof digestText;
|
|
15
21
|
mac: Readonly<{
|
|
16
22
|
verify: typeof verifyMac;
|
|
17
23
|
}>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAC3F,YAAY,EAAE,iBAAiB,EAAE,oBAAoB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AO,MAAM,GAAG;;EAEd,CAAC;AAEH,eAAO,MAAM,SAAS;;EAEpB,CAAC;AAEH,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,MAAM;;;;;;;;EAIjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { normalizeRs256Request, verifyRs256 } from './internal/rsa.js';
|
|
2
|
+
import { ownDataProperty } from './internal/data.js';
|
|
3
|
+
export { normalizeRsaPublicKey, normalizeRs256JoseVerifyRequest } from './internal/rsa.js';
|
|
4
|
+
export { CRYPTO_RS256_GUEST_LINKED_REALIZATION, CRYPTO_RS256_GUEST_LINKED_IMPLEMENTATION, CRYPTO_RS256_RUNTIME_BUILTIN_IMPLEMENTATION } from './contracts.js';
|
|
1
5
|
import { CRYPTO_ALGORITHMS, CRYPTO_CONTRACT_VERSION, CRYPTO_ES256_CONTRACT, CRYPTO_ES256_CONTRACT_VERSION, CRYPTO_ES256_GUEST_LINKED_IMPLEMENTATION, CRYPTO_ES256_GUEST_LINKED_REALIZATION, CRYPTO_ES256_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_GUEST_SOURCE_IMPLEMENTATION, CRYPTO_RESOURCE_LIMITS, CRYPTO_RUNTIME_BUILTIN_IMPLEMENTATION, CRYPTO_VERIFICATION_STATUSES, } from './contracts.js';
|
|
2
6
|
import { verifyEs256, verifyHs256 } from './internal/realization.js';
|
|
3
7
|
import { normalizeEs256JoseVerifyRequest, normalizeMacVerifyRequest, normalizeP256PublicKeyCoordinates, normalizeSignatureVerifyRequest, normalizeVerificationResult, } from './internal/verification.js';
|
|
@@ -21,6 +25,19 @@ export async function verifyMac(request) {
|
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
export async function verifySignature(request) {
|
|
28
|
+
let rsa = false;
|
|
29
|
+
try {
|
|
30
|
+
rsa = ownDataProperty(request, 'algorithm').value === 'RS256';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return normalizeVerificationResult({ status: 'invalid-input' });
|
|
34
|
+
}
|
|
35
|
+
if (rsa) {
|
|
36
|
+
const normalized = normalizeRs256Request(request);
|
|
37
|
+
if (!normalized.ok)
|
|
38
|
+
return normalized.result;
|
|
39
|
+
return normalizeVerificationResult(await verifyRs256(normalized.request));
|
|
40
|
+
}
|
|
24
41
|
let normalized;
|
|
25
42
|
try {
|
|
26
43
|
normalized = normalizeSignatureVerifyRequest(request);
|
|
@@ -44,7 +61,10 @@ export const mac = Object.freeze({
|
|
|
44
61
|
export const signature = Object.freeze({
|
|
45
62
|
verify: verifySignature,
|
|
46
63
|
});
|
|
64
|
+
export { DIGEST_TEXT_MAX_BYTES, digestText } from './digest.js';
|
|
65
|
+
import { digestText } from './digest.js';
|
|
47
66
|
export const crypto = Object.freeze({
|
|
67
|
+
digestText,
|
|
48
68
|
mac,
|
|
49
69
|
signature,
|
|
50
70
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,wCAAwC,EACxC,qCAAqC,EACrC,2CAA2C,EAC3C,kCAAkC,EAClC,sBAAsB,EACtB,qCAAqC,EACrC,4BAA4B,GAa7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAA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