@syferit/llvm 0.0.0-stage → 0.4.1

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.
@@ -0,0 +1,13 @@
1
+ export * from './types.js';
2
+ export * from './irTransformer.js';
3
+ export * from './nativeSourceTransformer.js';
4
+ import type { NativeProtectionOptions, NativeTransformResult } from './types.js';
5
+ /**
6
+ * Protects textual LLVM IR (`.ll`) modules with the Syferit 6-layer Iron Dome.
7
+ */
8
+ export declare function protectLlvmIr(irCode: string, options?: NativeProtectionOptions): NativeTransformResult;
9
+ /**
10
+ * Protects Native C, C++, or Rust source files with the Syferit 6-layer Iron Dome.
11
+ */
12
+ export declare function protectNativeSource(sourceCode: string, options?: NativeProtectionOptions): NativeTransformResult;
13
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,129 @@
1
+ export * from './types.js';
2
+ export * from './irTransformer.js';
3
+ export * from './nativeSourceTransformer.js';
4
+ import { LlvmIrTransformer } from './irTransformer.js';
5
+ import { NativeSourceTransformer } from './nativeSourceTransformer.js';
6
+ export function protectLlvmIr(irCode, options) {
7
+ function attestLlvmIrTransformer_d0e5(_tok0, _tok1, _tok2, _tok3) {
8
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:dbf8a997-0d2ad887]",
9
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
10
+ let _h = 2166136261;
11
+ for (let _s = 0; _s < _tokVec.length; _s++) {
12
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
13
+ _h = Math.imul(_h, 16777619) >>> 0;
14
+ _h ^= _h >>> 13;
15
+ }
16
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
17
+ _h ^= _legalAttestation.charCodeAt(_i);
18
+ _h = Math.imul(_h, 16777619) >>> 0;
19
+ _h ^= _h >>> 13;
20
+ }
21
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
22
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
23
+ _h = (_h ^ _h >>> 16) >>> 0;
24
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
25
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
26
+ if ((_h >>> 4 & 15) !== 7) {
27
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
28
+ }
29
+ return _h;
30
+ }
31
+ const __keyDerivationStateVector_d0e5 = attestLlvmIrTransformer_d0e5(1800647645, 707972615, 1648536327, 1572995649);
32
+ const _transformerBitmask_82d = new LlvmIrTransformer(options);
33
+ return (__keyDerivationStateVector_d0e5 & 255) === 124 ? _transformerBitmask_82d.transform(irCode) : (() => {
34
+ function verifyRingBufferSequence_795d(_tok0, _tok1, _tok2, _tok3) {
35
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:aa4a05f1-44a40fb6]",
36
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
37
+ let _h = 2166136261;
38
+ for (let _s = 0; _s < _tokVec.length; _s++) {
39
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
40
+ _h = Math.imul(_h, 16777619) >>> 0;
41
+ _h ^= _h >>> 13;
42
+ }
43
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
44
+ _h ^= _legalAttestation.charCodeAt(_i);
45
+ _h = Math.imul(_h, 16777619) >>> 0;
46
+ _h ^= _h >>> 13;
47
+ }
48
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
49
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
50
+ _h = (_h ^ _h >>> 16) >>> 0;
51
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
52
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
53
+ if ((_h >>> 4 & 15) !== 12) {
54
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
55
+ }
56
+ return _h;
57
+ }
58
+ const __tpmPcrBankAttestation_795d = verifyRingBufferSequence_795d(448164111, 988066157, 816988713, 798564453);
59
+ if ((__tpmPcrBankAttestation_795d & 255) !== 193) {
60
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
61
+ }
62
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
63
+ })();
64
+ }
65
+ export function protectNativeSource(sourceCode, options) {
66
+ function attestEnclaveDigestEnvelope_4ad2(_tok0, _tok1, _tok2, _tok3) {
67
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:ac1cb41c-bc30e0c7]",
68
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
69
+ let _h = 2166136261;
70
+ for (let _s = 0; _s < _tokVec.length; _s++) {
71
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
72
+ _h = Math.imul(_h, 16777619) >>> 0;
73
+ _h ^= _h >>> 13;
74
+ }
75
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
76
+ _h ^= _legalAttestation.charCodeAt(_i);
77
+ _h = Math.imul(_h, 16777619) >>> 0;
78
+ _h ^= _h >>> 13;
79
+ }
80
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
81
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
82
+ _h = (_h ^ _h >>> 16) >>> 0;
83
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
84
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
85
+ if ((_h >>> 4 & 15) !== 11) {
86
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
87
+ }
88
+ return _h;
89
+ }
90
+ const __hmacFrameVector_4ad2 = attestEnclaveDigestEnvelope_4ad2(804492855, 1154207357, 136951531, 886723619);
91
+ const _sboxTable_4ad2 = [[209, 81, 228], [177, 47, 201, 43, 52, 235, 121, 220, 160, 93, 190, 243, 231, 112, 28, 119, 83], [153, 5, 189, 17, 241, 137, 23, 78, 77, 224, 105, 201, 217, 83, 255, 93]];
92
+ function _sboxResolve_4ad2(_slot) {
93
+ const _row = _sboxTable_4ad2[_slot];
94
+ return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__hmacFrameVector_4ad2 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
95
+ }
96
+ const _keyDerivationStateSequence_a9d = options?.targetLanguage ?? _sboxResolve_4ad2(33219 ^ (__hmacFrameVector_4ad2 & 65535 ^ 32113));
97
+ const _sgxEcallCounter_244 = new NativeSourceTransformer(options);
98
+ return (__hmacFrameVector_4ad2 & 255) === 178 ? _sgxEcallCounter_244.transform(sourceCode, _keyDerivationStateSequence_a9d) : (() => {
99
+ function verifyTpmPcrBankVector_82bf(_tok0, _tok1, _tok2, _tok3) {
100
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:33e6011d-a435337b]",
101
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
102
+ let _h = 2166136261;
103
+ for (let _s = 0; _s < _tokVec.length; _s++) {
104
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
105
+ _h = Math.imul(_h, 16777619) >>> 0;
106
+ _h ^= _h >>> 13;
107
+ }
108
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
109
+ _h ^= _legalAttestation.charCodeAt(_i);
110
+ _h = Math.imul(_h, 16777619) >>> 0;
111
+ _h ^= _h >>> 13;
112
+ }
113
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
114
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
115
+ _h = (_h ^ _h >>> 16) >>> 0;
116
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
117
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
118
+ if ((_h >>> 4 & 15) !== 4) {
119
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
120
+ }
121
+ return _h;
122
+ }
123
+ const __enclaveDigestEnvelope_82bf = verifyTpmPcrBankVector_82bf(772817923, 1170665507, 1253773895, 896336543);
124
+ if ((__enclaveDigestEnvelope_82bf & 255) !== 78) {
125
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
126
+ }
127
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
128
+ })();
129
+ }
@@ -0,0 +1,21 @@
1
+ import type { NativeProtectionOptions, NativeTransformResult } from './types.js';
2
+ /**
3
+ * Portable LLVM Intermediate Representation (`.ll`) Transformer Engine
4
+ *
5
+ * Implements the exact 6-layer Iron Dome on textual LLVM IR modules:
6
+ * 1. Statutory Legal Inoculation Global (`@.syferit.legal.attestation` in `.rodata`)
7
+ * 2. Hash-Bound Runtime State Key Derivation Function (`define internal i32 @verify...`)
8
+ * 3. Symmetric Euler Quartic Residue Opaque Predicates (`(u | 1)^4 & 15 == 1`)
9
+ * 4. True Non-Linear Polynomial MBA on `add i32`, `sub i32`, `xor i32`
10
+ * 5. Key-Relative Constant Masking on immediate integer operands
11
+ * 6. 3-Layer Procedural CFG Anti-Fingerprinting + AST Identifier Harvesting
12
+ */
13
+ export declare class LlvmIrTransformer {
14
+ private options;
15
+ private prng;
16
+ private mba;
17
+ private seed;
18
+ constructor(options?: NativeProtectionOptions);
19
+ transform(irCode: string): NativeTransformResult;
20
+ }
21
+ //# sourceMappingURL=irTransformer.d.ts.map
@@ -0,0 +1,413 @@
1
+ import { SeededPRNG, MBASynthesizer, buildPolymorphicDictionary } from '@syferit/core';
2
+ export class LlvmIrTransformer {
3
+ options;
4
+ prng;
5
+ mba;
6
+ seed;
7
+ constructor(options = {}) {
8
+ this.options = options;
9
+ this.seed = typeof options.seed === 'number' ? options.seed : typeof options.seed === 'string' && options.seed.trim() !== '' ? SeededPRNG.hashString(options.seed) : SeededPRNG.generateCryptoSeed();
10
+ this.prng = new SeededPRNG(this.seed);
11
+ this.mba = new MBASynthesizer(this.prng);
12
+ }
13
+ transform(irCode) {
14
+ function verifySoltrixStudiosContext_60d2(_tok0, _tok1, _tok2, _tok3) {
15
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:89594933-9446f01d]",
16
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
17
+ let _h = 2166136261;
18
+ for (let _s = 0; _s < _tokVec.length; _s++) {
19
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
20
+ _h = Math.imul(_h, 16777619) >>> 0;
21
+ _h ^= _h >>> 13;
22
+ }
23
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
24
+ _h ^= _legalAttestation.charCodeAt(_i);
25
+ _h = Math.imul(_h, 16777619) >>> 0;
26
+ _h ^= _h >>> 13;
27
+ }
28
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
29
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
30
+ _h = (_h ^ _h >>> 16) >>> 0;
31
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
32
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
33
+ if ((_h >>> 4 & 15) !== 4) {
34
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
35
+ }
36
+ return _h;
37
+ }
38
+ const __ringBufferEnvelope_60d2 = verifySoltrixStudiosContext_60d2(1266999541, 1947723627, 128959073, 1194462343);
39
+ const _sboxTable_60d2 = [[44, 156, 188, 172, 188, 240, 22, 11, 24, 105, 104, 132, 100, 218, 254, 24], [10, 114, 114, 128, 110, 196, 232, 20, 243, 81, 88], [245, 85, 89, 121, 120, 225, 137, 174, 228, 87, 14, 65, 59, 138, 140, 165, 151], [203, 0, 47, 92], [187, 239, 3, 39, 46, 43, 51, 216, 90, 157, 196, 15, 237, 48, 70, 115, 89], [99, 207, 252], [79, 163, 208, 193, 202, 17, 62, 64, 58, 149, 186, 170, 140, 239, 18, 63, 19], [36, 134, 143, 156, 145, 252, 25, 37, 1, 112, 85, 135, 103, 210, 245, 26, 248], [2, 111, 101], [243, 81, 79, 97, 75, 165, 165, 254, 215, 20, 59, 89, 51, 143, 141, 173], [206, 16, 55, 31, 119], [188, 187, 68]];
40
+ function _sboxResolve_60d2(_slot) {
41
+ const _row = _sboxTable_60d2[_slot];
42
+ return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__ringBufferEnvelope_60d2 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
43
+ }
44
+ if (this.options.mode === _sboxResolve_60d2(48031 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 30422)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 44 | 1, ((irCode.seats || irCode | 0) | 0) ^ 44 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 44 | 1, ((irCode.seats || irCode | 0) | 0) ^ 44 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 4 & 255 ^ 79)) === 156) {
45
+ return {
46
+ code: irCode,
47
+ transformedCount: (52697 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535),
48
+ seedUsed: this.seed,
49
+ inoculationInjected: false,
50
+ stateKeyDerived: (52697 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535)
51
+ };
52
+ } else if (this.options.mode === _sboxResolve_60d2(53341 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 7445)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 42 | 1, ((irCode.seats || irCode | 0) | 0) ^ 42 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 42 | 1, ((irCode.seats || irCode | 0) | 0) ^ 42 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 3 & 255 ^ 202)) === 98) {
53
+ return {
54
+ code: irCode,
55
+ transformedCount: 34687 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 18998),
56
+ seedUsed: this.seed,
57
+ inoculationInjected: false,
58
+ stateKeyDerived: 52954 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 915)
59
+ };
60
+ } else if (this.options.mode === _sboxResolve_60d2(33839 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 18788)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 34 | 1, ((irCode.seats || irCode | 0) | 0) ^ 34 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 34 | 1, ((irCode.seats || irCode | 0) | 0) ^ 34 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 23 & 255 ^ 167)) === 9) {
61
+ return {
62
+ code: irCode,
63
+ transformedCount: (53055 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535),
64
+ seedUsed: this.seed,
65
+ inoculationInjected: false,
66
+ stateKeyDerived: (53103 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535)
67
+ };
68
+ }
69
+ const _keyDerivationStateBitmask_dc9 = [];
70
+ const _ringBufferBitmask_810 = /define\s+[^@]*@([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g;
71
+ let _SyferitEngineDelta_81e;
72
+ while ((_SyferitEngineDelta_81e = _ringBufferBitmask_810.exec(irCode)) !== null) {
73
+ if (_SyferitEngineDelta_81e[35784 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 18048)] && _SyferitEngineDelta_81e[39221 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 21629)].length >= (40212 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 20569))) {
74
+ _keyDerivationStateBitmask_dc9.push(_SyferitEngineDelta_81e[51498 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 1122)]);
75
+ }
76
+ }
77
+ const _keyDerivationStateProof_5c0 = buildPolymorphicDictionary(this.options.domainProfile ?? _sboxResolve_60d2(58051 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 12169)), this.prng, _keyDerivationStateBitmask_dc9, this.options.customDictionary ?? []);
78
+ const _LlvmIrTransformerBitmask_c93 = this.prng.pick(_keyDerivationStateProof_5c0.legalInoculations);
79
+ const _tpmPcrBankIntegrity_bac = `${this.prng.nextUint32().toString(33228 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 19605)).padStart(49385 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 3496), '0')}-${this.prng.nextUint32().toString(43823 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 26230)).padStart(54984 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 7049), '0')}`;
80
+ const _MBASynthesizerIntegrity_585 = `${_LlvmIrTransformerBitmask_c93} [ATTESTATION_ID:${_tpmPcrBankIntegrity_bac}]`;
81
+ const _constructorAttestation_2e = (this.prng.nextUint32() & (25580 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 20826))).toString(41220 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 27741));
82
+ const _generateCryptoSeedSequence_795 = `${this.prng.pick(_keyDerivationStateProof_5c0.symbols)}_${_constructorAttestation_2e}`;
83
+ const _ProprietaryEnclaveDelta_76e = `${this.prng.pick(_keyDerivationStateProof_5c0.stateKeys)}_${_constructorAttestation_2e}`;
84
+ const _SoltrixStudiosDelta_521 = this.prng.nextUint32() & 2147483646 + ((__ringBufferEnvelope_60d2 & 255) - 73) | 64463 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 13959);
85
+ const _pcrPolicyBitmask_a52 = this.mba.computeStringKey(_MBASynthesizerIntegrity_585, _SoltrixStudiosDelta_521);
86
+ const _seedUsedProof_7ad = _pcrPolicyBitmask_a52 >>> (57209 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 4660)) & (43729 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 26519));
87
+ let _fnMatchRegexBitmask_37f = 57618 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 11355);
88
+ let _hashStringIntegrity_936 = 58510 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 10694);
89
+ const _hkdfSaltRotation_a86 = irCode.replace(/(define\s+[^@{]+@[a-zA-Z0-9_$.]+\s*\([^)]*\)[^{]*\{)([\s\S]*?)(\n\})/g, (_fullMatch, header, body, footer) => {
90
+ function evaluateStateKeyDerived_e21a(_tok0, _tok1, _tok2, _tok3) {
91
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:cc0dae3a-f10c6ed9]",
92
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
93
+ let _h = 2166136261;
94
+ for (let _s = 0; _s < _tokVec.length; _s++) {
95
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
96
+ _h = Math.imul(_h, 16777619) >>> 0;
97
+ _h ^= _h >>> 13;
98
+ }
99
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
100
+ _h ^= _legalAttestation.charCodeAt(_i);
101
+ _h = Math.imul(_h, 16777619) >>> 0;
102
+ _h ^= _h >>> 13;
103
+ }
104
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
105
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
106
+ _h = (_h ^ _h >>> 16) >>> 0;
107
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
108
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
109
+ if ((_h >>> 4 & 15) !== 3) {
110
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
111
+ }
112
+ return _h;
113
+ }
114
+ const __hmacFrameProof_e21a = evaluateStateKeyDerived_e21a(2036038201, 1378167583, 1167636171, 1291213639);
115
+ _fnMatchRegexBitmask_37f++;
116
+ const _tpmPcrBankEnvelope_e9a = `%${_ProprietaryEnclaveDelta_76e}_k${_fnMatchRegexBitmask_37f}`;
117
+ const _tpmPcrBankIntegrity_833 = body.match(/^(\s*[a-zA-Z0-9_$.]+:\s*\n)/);
118
+ let _hkdfSaltRotation_d24 = `\n ${_tpmPcrBankEnvelope_e9a} = call i32 @${_generateCryptoSeedSequence_795}(i32 ${_SoltrixStudiosDelta_521})\n`;
119
+ const _enclaveDigestIntegrity_d20 = body.replace(/^(\s*)(%[a-zA-Z0-9_$.]+)\s*=\s*(add|sub|xor)(?:\s+nsw|\s+nuw)*\s+i32\s+([^,\n]+),\s*([^\n]+)$/gm, (_instMatch, indent, destReg, op, lhsRaw, rhsRaw) => {
120
+ function verifySyferitEngineContext_d8ac(_tok0, _tok1, _tok2, _tok3) {
121
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:d90bf982-e7e9fdee]",
122
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
123
+ let _h = 2166136261;
124
+ for (let _s = 0; _s < _tokVec.length; _s++) {
125
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
126
+ _h = Math.imul(_h, 16777619) >>> 0;
127
+ _h ^= _h >>> 13;
128
+ }
129
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
130
+ _h ^= _legalAttestation.charCodeAt(_i);
131
+ _h = Math.imul(_h, 16777619) >>> 0;
132
+ _h ^= _h >>> 13;
133
+ }
134
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
135
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
136
+ _h = (_h ^ _h >>> 16) >>> 0;
137
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
138
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
139
+ if ((_h >>> 4 & 15) !== 5) {
140
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
141
+ }
142
+ return _h;
143
+ }
144
+ const __hmacFrameBitmask_d8ac = verifySyferitEngineContext_d8ac(630122899, 1739493023, 1807823785, 1973390809);
145
+ const _seedUsedProof_2c6 = lhsRaw.trim();
146
+ let _entropyNonceSequence_e1c = rhsRaw.trim();
147
+ const _transformSequence_f71 = _hashStringIntegrity_936++;
148
+ const _pcrPolicyBitmask_3ea = [];
149
+ if (/^-?\d+$/.test(_entropyNonceSequence_e1c)) {
150
+ const literalVal = parseInt(_entropyNonceSequence_e1c, 64024 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 14171)) | 40645 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 21388);
151
+ const mask = this.prng.nextUint32() & 2147483646 + ((__ringBufferEnvelope_60d2 & 255) - 73) | 51792 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 1816);
152
+ const c1 = literalVal ^ mask | 50679 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 2238);
153
+ const c2 = mask ^ _pcrPolicyBitmask_a52 | 50242 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 2315);
154
+ const tMask1 = `%_m_kxor_${_transformSequence_f71}`;
155
+ const tMask2 = `%_m_const_${_transformSequence_f71}`;
156
+ _pcrPolicyBitmask_3ea.push(`${indent}${tMask1} = xor i32 ${_tpmPcrBankEnvelope_e9a}, ${c2}`);
157
+ _pcrPolicyBitmask_3ea.push(`${indent}${tMask2} = xor i32 ${c1}, ${tMask1}`);
158
+ _entropyNonceSequence_e1c = tMask2;
159
+ }
160
+ if (op === _sboxResolve_60d2(51350 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 1499)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 80 | 1, ((irCode.seats || irCode | 0) | 0) ^ 80 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 80 | 1, ((irCode.seats || irCode | 0) | 0) ^ 80 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 4 & 255 ^ 94)) === 137) {
161
+ const tXor = `%_m_axor_${_transformSequence_f71}`;
162
+ const tAnd = `%_m_aand_${_transformSequence_f71}`;
163
+ const tShl = `%_m_ashl_${_transformSequence_f71}`;
164
+ const tBase = `%_m_abase_${_transformSequence_f71}`;
165
+ const tU0 = `%_m_u0_${_transformSequence_f71}`;
166
+ const tU1 = `%_m_u1_${_transformSequence_f71}`;
167
+ const tU2 = `%_m_u2_${_transformSequence_f71}`;
168
+ const tU4 = `%_m_u4_${_transformSequence_f71}`;
169
+ const tQ1 = `%_m_q1_${_transformSequence_f71}`;
170
+ const tKOne1 = `%_m_ko1_${_transformSequence_f71}`;
171
+ const tKOne2 = `%_m_ko2_${_transformSequence_f71}`;
172
+ const tZero = `%_m_zinv_${_transformSequence_f71}`;
173
+ const oneMask = this.prng.nextUint32() & (52283 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535) | (52283 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
174
+ const oneC1 = (53055 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535) ^ oneMask | (52283 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
175
+ const oneC2 = oneMask ^ _pcrPolicyBitmask_a52 | (52283 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
176
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
177
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
178
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
179
+ _pcrPolicyBitmask_3ea.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
180
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU0} = xor i32 ${_seedUsedProof_2c6}, ${_tpmPcrBankEnvelope_e9a}`);
181
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
182
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
183
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
184
+ _pcrPolicyBitmask_3ea.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
185
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne1} = xor i32 ${_tpmPcrBankEnvelope_e9a}, ${oneC2}`);
186
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
187
+ _pcrPolicyBitmask_3ea.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
188
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
189
+ return _pcrPolicyBitmask_3ea.join('\n');
190
+ } else if (op === _sboxResolve_60d2(49199 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 3427)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 63 | 1, ((irCode.seats || irCode | 0) | 0) ^ 63 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 63 | 1, ((irCode.seats || irCode | 0) | 0) ^ 63 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 18 & 255 ^ 61)) === 89) {
191
+ const tXor = `%_m_axor_${_transformSequence_f71}`;
192
+ const tAnd = `%_m_aand_${_transformSequence_f71}`;
193
+ const tShl = `%_m_ashl_${_transformSequence_f71}`;
194
+ const tBase = `%_m_abase_${_transformSequence_f71}`;
195
+ const tU0 = `%_m_u0_${_transformSequence_f71}`;
196
+ const tU1 = `%_m_u1_${_transformSequence_f71}`;
197
+ const tU2 = `%_m_u2_${_transformSequence_f71}`;
198
+ const tU4 = `%_m_u4_${_transformSequence_f71}`;
199
+ const tQ1 = `%_m_q1_${_transformSequence_f71}`;
200
+ const tKOne1 = `%_m_ko1_${_transformSequence_f71}`;
201
+ const tKOne2 = `%_m_ko2_${_transformSequence_f71}`;
202
+ const tZero = `%_m_zinv_${_transformSequence_f71}`;
203
+ const oneMask = this.prng.nextUint32() & 2147483646 + ((__ringBufferEnvelope_60d2 & 255) - 73) | 35754 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 18146);
204
+ const oneC1 = 33499 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 20371) ^ oneMask | 63651 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 13802);
205
+ const oneC2 = oneMask ^ _pcrPolicyBitmask_a52 | 65426 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 13019);
206
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
207
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
208
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
209
+ _pcrPolicyBitmask_3ea.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
210
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU0} = xor i32 ${_seedUsedProof_2c6}, ${_tpmPcrBankEnvelope_e9a}`);
211
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
212
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
213
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
214
+ _pcrPolicyBitmask_3ea.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
215
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne1} = xor i32 ${_tpmPcrBankEnvelope_e9a}, ${oneC2}`);
216
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
217
+ _pcrPolicyBitmask_3ea.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
218
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
219
+ return _pcrPolicyBitmask_3ea.join('\n');
220
+ } else if (op === _sboxResolve_60d2(63953 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 13470)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 97 | 1, ((irCode.seats || irCode | 0) | 0) ^ 97 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 97 | 1, ((irCode.seats || irCode | 0) | 0) ^ 97 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 4 & 255 ^ 90)) === 139) {
221
+ const tXor = `%_m_axor_${_transformSequence_f71}`;
222
+ const tAnd = `%_m_aand_${_transformSequence_f71}`;
223
+ const tShl = `%_m_ashl_${_transformSequence_f71}`;
224
+ const tBase = `%_m_abase_${_transformSequence_f71}`;
225
+ const tU0 = `%_m_u0_${_transformSequence_f71}`;
226
+ const tU1 = `%_m_u1_${_transformSequence_f71}`;
227
+ const tU2 = `%_m_u2_${_transformSequence_f71}`;
228
+ const tU4 = `%_m_u4_${_transformSequence_f71}`;
229
+ const tQ1 = `%_m_q1_${_transformSequence_f71}`;
230
+ const tKOne1 = `%_m_ko1_${_transformSequence_f71}`;
231
+ const tKOne2 = `%_m_ko2_${_transformSequence_f71}`;
232
+ const tZero = `%_m_zinv_${_transformSequence_f71}`;
233
+ const oneMask = this.prng.nextUint32() & (53055 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535) | (52283 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
234
+ const oneC1 = (53055 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535) ^ oneMask | (52697 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
235
+ const oneC2 = oneMask ^ _pcrPolicyBitmask_a52 | (53055 ^ __ringBufferEnvelope_60d2 & 65535) / (20829 ^ __ringBufferEnvelope_60d2 >>> 16 & 65535);
236
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
237
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
238
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
239
+ _pcrPolicyBitmask_3ea.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
240
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU0} = xor i32 ${_seedUsedProof_2c6}, ${_tpmPcrBankEnvelope_e9a}`);
241
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
242
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
243
+ _pcrPolicyBitmask_3ea.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
244
+ _pcrPolicyBitmask_3ea.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
245
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne1} = xor i32 ${_tpmPcrBankEnvelope_e9a}, ${oneC2}`);
246
+ _pcrPolicyBitmask_3ea.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
247
+ _pcrPolicyBitmask_3ea.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
248
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
249
+ return _pcrPolicyBitmask_3ea.join('\n');
250
+ }
251
+ if (op === _sboxResolve_60d2(51727 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 1857)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 45 | 1, ((irCode.seats || irCode | 0) | 0) ^ 45 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 45 | 1, ((irCode.seats || irCode | 0) | 0) ^ 45 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 10 & 255 ^ 153)) === 233) {
252
+ const tXor = `%_m_sxor_${_transformSequence_f71}`;
253
+ const tNot = `%_m_snot_${_transformSequence_f71}`;
254
+ const tAnd = `%_m_sand_${_transformSequence_f71}`;
255
+ const tShl = `%_m_sshl_${_transformSequence_f71}`;
256
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
257
+ _pcrPolicyBitmask_3ea.push(`${indent}${tNot} = xor i32 ${_seedUsedProof_2c6}, -1`);
258
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${tNot}, ${_entropyNonceSequence_e1c}`);
259
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
260
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
261
+ return _pcrPolicyBitmask_3ea.join('\n');
262
+ } else if (op === _sboxResolve_60d2(50721 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 2912)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 84 | 1, ((irCode.seats || irCode | 0) | 0) ^ 84 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 84 | 1, ((irCode.seats || irCode | 0) | 0) ^ 84 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 15 & 255 ^ 151)) === 189) {
263
+ const tXor = `%_m_sxor_${_transformSequence_f71}`;
264
+ const tNot = `%_m_snot_${_transformSequence_f71}`;
265
+ const tAnd = `%_m_sand_${_transformSequence_f71}`;
266
+ const tShl = `%_m_sshl_${_transformSequence_f71}`;
267
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
268
+ _pcrPolicyBitmask_3ea.push(`${indent}${tNot} = xor i32 ${_seedUsedProof_2c6}, -1`);
269
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${tNot}, ${_entropyNonceSequence_e1c}`);
270
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
271
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
272
+ return _pcrPolicyBitmask_3ea.join('\n');
273
+ } else if (op === _sboxResolve_60d2(50415 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 2479)) && (Math.imul(Math.imul(((irCode.seats || irCode | 0) | 0) ^ 47 | 1, ((irCode.seats || irCode | 0) | 0) ^ 47 | 1), Math.imul(((irCode.seats || irCode | 0) | 0) ^ 47 | 1, ((irCode.seats || irCode | 0) | 0) ^ 47 | 1)) & 15 ^ (__ringBufferEnvelope_60d2 >>> 19 & 255 ^ 65)) === 124) {
274
+ const tXor = `%_m_sxor_${_transformSequence_f71}`;
275
+ const tNot = `%_m_snot_${_transformSequence_f71}`;
276
+ const tAnd = `%_m_sand_${_transformSequence_f71}`;
277
+ const tShl = `%_m_sshl_${_transformSequence_f71}`;
278
+ _pcrPolicyBitmask_3ea.push(`${indent}${tXor} = xor i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
279
+ _pcrPolicyBitmask_3ea.push(`${indent}${tNot} = xor i32 ${_seedUsedProof_2c6}, -1`);
280
+ _pcrPolicyBitmask_3ea.push(`${indent}${tAnd} = and i32 ${tNot}, ${_entropyNonceSequence_e1c}`);
281
+ _pcrPolicyBitmask_3ea.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
282
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
283
+ return _pcrPolicyBitmask_3ea.join('\n');
284
+ }
285
+ const _generateCryptoSeedSequence_cd6 = `%_m_xor_or_${_transformSequence_f71}`;
286
+ const _prngAttestation_471 = `%_m_xor_and_${_transformSequence_f71}`;
287
+ _pcrPolicyBitmask_3ea.push(`${indent}${_generateCryptoSeedSequence_cd6} = or i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
288
+ _pcrPolicyBitmask_3ea.push(`${indent}${_prngAttestation_471} = and i32 ${_seedUsedProof_2c6}, ${_entropyNonceSequence_e1c}`);
289
+ _pcrPolicyBitmask_3ea.push(`${indent}${destReg} = sub i32 ${_generateCryptoSeedSequence_cd6}, ${_prngAttestation_471}`);
290
+ return (__hmacFrameBitmask_d8ac & 255) === 81 ? _pcrPolicyBitmask_3ea.join('\n') : (() => {
291
+ function attestOptions_754b(_tok0, _tok1, _tok2, _tok3) {
292
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:20031e9f-d2038a3e]",
293
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
294
+ let _h = 2166136261;
295
+ for (let _s = 0; _s < _tokVec.length; _s++) {
296
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
297
+ _h = Math.imul(_h, 16777619) >>> 0;
298
+ _h ^= _h >>> 13;
299
+ }
300
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
301
+ _h ^= _legalAttestation.charCodeAt(_i);
302
+ _h = Math.imul(_h, 16777619) >>> 0;
303
+ _h ^= _h >>> 13;
304
+ }
305
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
306
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
307
+ _h = (_h ^ _h >>> 16) >>> 0;
308
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
309
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
310
+ if ((_h >>> 4 & 15) !== 12) {
311
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
312
+ }
313
+ return _h;
314
+ }
315
+ const __hmacFrameEnvelope_754b = attestOptions_754b(840437631, 1493001221, 1963218793, 512139989);
316
+ if ((__hmacFrameEnvelope_754b & 255) !== 198) {
317
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
318
+ }
319
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
320
+ })();
321
+ });
322
+ if (_tpmPcrBankIntegrity_833) {
323
+ const labelPart = _tpmPcrBankIntegrity_833[34378 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 19202)];
324
+ const rest = _enclaveDigestIntegrity_d20.slice(labelPart.length);
325
+ return `${header}${labelPart}${_hkdfSaltRotation_d24}${rest}${footer}`;
326
+ }
327
+ return (__hmacFrameProof_e21a & 255) === 55 ? `${header}${_hkdfSaltRotation_d24}${_enclaveDigestIntegrity_d20}${footer}` : (() => {
328
+ function rotateHarvested_5341(_tok0, _tok1, _tok2, _tok3) {
329
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:28164622-33f74572]",
330
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
331
+ let _h = 2166136261;
332
+ for (let _s = 0; _s < _tokVec.length; _s++) {
333
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
334
+ _h = Math.imul(_h, 16777619) >>> 0;
335
+ _h ^= _h >>> 13;
336
+ }
337
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
338
+ _h ^= _legalAttestation.charCodeAt(_i);
339
+ _h = Math.imul(_h, 16777619) >>> 0;
340
+ _h ^= _h >>> 13;
341
+ }
342
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
343
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
344
+ _h = (_h ^ _h >>> 16) >>> 0;
345
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
346
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
347
+ if ((_h >>> 4 & 15) !== 10) {
348
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
349
+ }
350
+ return _h;
351
+ }
352
+ const __enclaveBoundaryCheck_5341 = rotateHarvested_5341(1777057355, 527157793, 1175959701, 1509412737);
353
+ if ((__enclaveBoundaryCheck_5341 & 255) !== 163) {
354
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
355
+ }
356
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
357
+ })();
358
+ });
359
+ if (_fnMatchRegexBitmask_37f === (50810 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 2867))) {
360
+ return {
361
+ code: irCode,
362
+ transformedCount: 33612 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 19973),
363
+ seedUsed: this.seed,
364
+ inoculationInjected: false,
365
+ stateKeyDerived: 38751 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 23062)
366
+ };
367
+ }
368
+ const _monotonicNonceDrift_e3e = Buffer.from(_MBASynthesizerIntegrity_585, _sboxResolve_60d2(62897 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 14578)));
369
+ const _seedAttestation_6a = _monotonicNonceDrift_e3e.length + (40339 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 20699));
370
+ const _ringBufferEnvelope_f66 = _MBASynthesizerIntegrity_585.replace(/\\/g, '\\\\').replace(/"/g, _sboxResolve_60d2(47449 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 29723)));
371
+ const _hmacFrameBitmask_4e5 = 1511516595 + ((__ringBufferEnvelope_60d2 & 255) - 73);
372
+ const _stateKeyDerivedBitmask_7e0 = _SoltrixStudiosDelta_521 ^ _hmacFrameBitmask_4e5 | 61622 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 15871);
373
+ const _hmacFrameEnvelope_7dc = (_pcrPolicyBitmask_a52 | 35964 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 16693)) - _stateKeyDerivedBitmask_7e0 | 47211 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 29986);
374
+ const _tpmPcrBankEnvelope_a19 = [`; [Syferit Adversarial LLVM IR Protection Engine v0.4.0]`, `@.syferit.legal.attestation_${_constructorAttestation_2e} = private unnamed_addr constant [${_seedAttestation_6a} x i8] c"${_ringBufferEnvelope_f66}\\00", align 1`, `@llvm.compiler.used = appending global [1 x ptr] [ptr @.syferit.legal.attestation_${_constructorAttestation_2e}], section "llvm.metadata"`, ``, `declare void @llvm.trap() #0`, ``, `define internal i32 @${_generateCryptoSeedSequence_795}(i32 %_tok) noinline optnone {`, `entry:`, ` %_att_byte = load volatile i8, ptr @.syferit.legal.attestation_${_constructorAttestation_2e}, align 1`, ` %_att_valid = icmp ne i8 %_att_byte, 0`, ` %_x0 = xor i32 %_tok, ${_hmacFrameBitmask_4e5}`, ` %_key = add i32 %_x0, ${_hmacFrameEnvelope_7dc}`, ` %_shr = lshr i32 %_key, 4`, ` %_nib = and i32 %_shr, 15`, ` %_nib_ok = icmp eq i32 %_nib, ${_seedUsedProof_7ad}`, ` %_all_ok = and i1 %_att_valid, %_nib_ok`, ` br i1 %_all_ok, label %hash.ok, label %tamper.trap`, ``, `tamper.trap:`, ` call void @llvm.trap()`, ` unreachable`, ``, `hash.ok:`, ` ret i32 %_key`, `}`, ``].join('\n');
375
+ return (__ringBufferEnvelope_60d2 & 255) === 73 ? {
376
+ code: `${_tpmPcrBankEnvelope_a19}\n${_hkdfSaltRotation_a86}`,
377
+ transformedCount: _fnMatchRegexBitmask_37f,
378
+ seedUsed: this.seed,
379
+ inoculationInjected: true,
380
+ stateKeyDerived: _pcrPolicyBitmask_a52 >>> (46849 ^ (__ringBufferEnvelope_60d2 & 65535 ^ 31304))
381
+ } : (() => {
382
+ function rotateRingBufferBitmask_4f8e(_tok0, _tok1, _tok2, _tok3) {
383
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:c52ee01d-e5ea10cb]",
384
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
385
+ let _h = 2166136261;
386
+ for (let _s = 0; _s < _tokVec.length; _s++) {
387
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
388
+ _h = Math.imul(_h, 16777619) >>> 0;
389
+ _h ^= _h >>> 13;
390
+ }
391
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
392
+ _h ^= _legalAttestation.charCodeAt(_i);
393
+ _h = Math.imul(_h, 16777619) >>> 0;
394
+ _h ^= _h >>> 13;
395
+ }
396
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
397
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
398
+ _h = (_h ^ _h >>> 16) >>> 0;
399
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
400
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
401
+ if ((_h >>> 4 & 15) !== 6) {
402
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
403
+ }
404
+ return _h;
405
+ }
406
+ const __ringBufferBitmask_4f8e = rotateRingBufferBitmask_4f8e(739905833, 1856896621, 1701367777, 2080169809);
407
+ if ((__ringBufferBitmask_4f8e & 255) !== 106) {
408
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
409
+ }
410
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
411
+ })();
412
+ }
413
+ }
@@ -0,0 +1,26 @@
1
+ import type { NativeProtectionOptions, NativeTransformResult, NativeTargetLanguage } from './types.js';
2
+ /**
3
+ * Native C / C++ / Rust Source-Level Adversarial Transformer
4
+ *
5
+ * Applies the full 6-layer Syferit Iron Dome directly to native C, C++, and Rust
6
+ * source files before compilation (providing 100% compiler-version-independent
7
+ * protection across MSVC, GCC, Clang, rustc, Android NDK, and Xcode):
8
+ *
9
+ * 1. Statutory Legal Inoculation (`__attribute__((used))` / `#[used]` in `.rodata`/`.rdata`)
10
+ * 2. Hash-Bound Runtime State Key Derivation (FNV-1a + MurmurHash3 over legal notice)
11
+ * 3. Symmetric Euler Quartic Residue Predicates (`((u | 1)^4 & 15) == 1`)
12
+ * 4. True Non-Linear Polynomial MBA on integer arithmetic & constants
13
+ * 5. Dynamic S-Box String Literal Encryption (blinds `strings` & Ghidra XREFs)
14
+ * 6. 3-Layer Procedural CFG Anti-Fingerprinting + Identifier Harvesting
15
+ */
16
+ export declare class NativeSourceTransformer {
17
+ private options;
18
+ private prng;
19
+ private mba;
20
+ private seed;
21
+ constructor(options?: NativeProtectionOptions);
22
+ transform(sourceCode: string, lang?: NativeTargetLanguage): NativeTransformResult;
23
+ private transformCCpp;
24
+ private transformRust;
25
+ }
26
+ //# sourceMappingURL=nativeSourceTransformer.d.ts.map
@@ -0,0 +1,420 @@
1
+ import { SeededPRNG, MBASynthesizer, buildPolymorphicDictionary } from '@syferit/core';
2
+ export class NativeSourceTransformer {
3
+ options;
4
+ prng;
5
+ mba;
6
+ seed;
7
+ constructor(options = {}) {
8
+ this.options = options;
9
+ this.seed = typeof options.seed === 'number' ? options.seed : typeof options.seed === 'string' && options.seed.trim() !== '' ? SeededPRNG.hashString(options.seed) : SeededPRNG.generateCryptoSeed();
10
+ this.prng = new SeededPRNG(this.seed);
11
+ this.mba = new MBASynthesizer(this.prng);
12
+ }
13
+ transform(sourceCode, lang = _sboxResolve_24b5(22204 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 20412))) {
14
+ function unsealTransformCCpp_24b5(_tok0, _tok1, _tok2, _tok3) {
15
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:8d42dfe5-dbf62d9b]",
16
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
17
+ let _h = 2166136261;
18
+ for (let _s = 0; _s < _tokVec.length; _s++) {
19
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
20
+ _h = Math.imul(_h, 16777619) >>> 0;
21
+ _h ^= _h >>> 13;
22
+ }
23
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
24
+ _h ^= _legalAttestation.charCodeAt(_i);
25
+ _h = Math.imul(_h, 16777619) >>> 0;
26
+ _h ^= _h >>> 13;
27
+ }
28
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
29
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
30
+ _h = (_h ^ _h >>> 16) >>> 0;
31
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
32
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
33
+ if ((_h >>> 4 & 15) !== 0) {
34
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
35
+ }
36
+ return _h;
37
+ }
38
+ const __keyDerivationStateProof_24b5 = unsealTransformCCpp_24b5(51434989, 348327167, 1329744661, 2029321735);
39
+ const _sboxTable_24b5 = [[99, 78, 82], [77, 16, 42, 41, 200, 130, 180, 120, 56, 230, 48, 242, 142, 124, 104, 87, 17], [46, 237, 26, 254, 178, 115, 112, 66, 23, 222, 224], [10, 195, 242, 172, 98, 55, 64, 11, 254, 166, 214, 132, 74, 29, 40, 24], [241, 188, 213, 137, 73, 16, 47, 38, 213, 137, 177, 97, 49, 250, 23, 197], [203, 130, 168, 126], [184, 117, 112, 92, 45, 129, 160, 243, 89, 119, 119, 36, 238, 170, 213, 136, 90]];
40
+ function _sboxResolve_24b5(_slot) {
41
+ const _row = _sboxTable_24b5[_slot];
42
+ return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__keyDerivationStateProof_24b5 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
43
+ }
44
+ if (this.options.mode === _sboxResolve_24b5(27952 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 29745)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 46 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 46 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 46 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 46 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 1 & 255 ^ 133)) === 10) {
45
+ return {
46
+ code: sourceCode,
47
+ transformedCount: (6950 ^ __keyDerivationStateProof_24b5 & 65535) / (57872 ^ __keyDerivationStateProof_24b5 >>> 16 & 65535),
48
+ seedUsed: this.seed,
49
+ inoculationInjected: false,
50
+ stateKeyDerived: (6530 ^ __keyDerivationStateProof_24b5 & 65535) / (57872 ^ __keyDerivationStateProof_24b5 >>> 16 & 65535)
51
+ };
52
+ } else if (this.options.mode === _sboxResolve_24b5(4203 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 2409)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 52 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 52 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 52 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 52 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 9 & 255 ^ 57)) === 52) {
53
+ return {
54
+ code: sourceCode,
55
+ transformedCount: 855 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 6743),
56
+ seedUsed: this.seed,
57
+ inoculationInjected: false,
58
+ stateKeyDerived: 19495 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 21799)
59
+ };
60
+ } else if (this.options.mode === _sboxResolve_24b5(29344 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 27555)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 63 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 63 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 63 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 63 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 3 & 255 ^ 207)) === 226) {
61
+ return {
62
+ code: sourceCode,
63
+ transformedCount: (7030 ^ __keyDerivationStateProof_24b5 & 65535) / (57872 ^ __keyDerivationStateProof_24b5 >>> 16 & 65535),
64
+ seedUsed: this.seed,
65
+ inoculationInjected: false,
66
+ stateKeyDerived: (6530 ^ __keyDerivationStateProof_24b5 & 65535) / (57872 ^ __keyDerivationStateProof_24b5 >>> 16 & 65535)
67
+ };
68
+ }
69
+ if (lang === _sboxResolve_24b5(11864 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 14172)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 44 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 44 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 44 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 44 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 1 & 255 ^ 147)) === 26) {
70
+ return this.transformRust(sourceCode);
71
+ } else if (lang === _sboxResolve_24b5(8859 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 15262)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 19 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 19 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 19 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 19 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 23 & 255 ^ 211)) === 23) {
72
+ return this.transformRust(sourceCode);
73
+ } else if (lang === _sboxResolve_24b5(55 ^ (__keyDerivationStateProof_24b5 & 65535 ^ 6449)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 109 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 109 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 109 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 109 | 1)) & 15 ^ (__keyDerivationStateProof_24b5 >>> 5 & 255 ^ 166)) === 105) {
74
+ return this.transformRust(sourceCode);
75
+ }
76
+ return (__keyDerivationStateProof_24b5 & 255) === 0 ? this.transformCCpp(sourceCode) : (() => {
77
+ function verifyProprietaryEnclaveContext_ea1c(_tok0, _tok1, _tok2, _tok3) {
78
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:22318bd6-4a9eb089]",
79
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
80
+ let _h = 2166136261;
81
+ for (let _s = 0; _s < _tokVec.length; _s++) {
82
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
83
+ _h = Math.imul(_h, 16777619) >>> 0;
84
+ _h ^= _h >>> 13;
85
+ }
86
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
87
+ _h ^= _legalAttestation.charCodeAt(_i);
88
+ _h = Math.imul(_h, 16777619) >>> 0;
89
+ _h ^= _h >>> 13;
90
+ }
91
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
92
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
93
+ _h = (_h ^ _h >>> 16) >>> 0;
94
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
95
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
96
+ if ((_h >>> 4 & 15) !== 14) {
97
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
98
+ }
99
+ return _h;
100
+ }
101
+ const __enclaveDigestEnvelope_ea1c = verifyProprietaryEnclaveContext_ea1c(1023436591, 129706199, 1001995653, 1400050561);
102
+ if ((__enclaveDigestEnvelope_ea1c & 255) !== 233) {
103
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
104
+ }
105
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
106
+ })();
107
+ }
108
+ transformCCpp(sourceCode) {
109
+ function unsealTpmPcrBankEnvelope_1853(_tok0, _tok1, _tok2, _tok3) {
110
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:992068ef-1bbd9cb0]",
111
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
112
+ let _h = 2166136261;
113
+ for (let _s = 0; _s < _tokVec.length; _s++) {
114
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
115
+ _h = Math.imul(_h, 16777619) >>> 0;
116
+ _h ^= _h >>> 13;
117
+ }
118
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
119
+ _h ^= _legalAttestation.charCodeAt(_i);
120
+ _h = Math.imul(_h, 16777619) >>> 0;
121
+ _h ^= _h >>> 13;
122
+ }
123
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
124
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
125
+ _h = (_h ^ _h >>> 16) >>> 0;
126
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
127
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
128
+ if ((_h >>> 4 & 15) !== 1) {
129
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
130
+ }
131
+ return _h;
132
+ }
133
+ const __entropySeedDigest_1853 = unsealTpmPcrBankEnvelope_1853(1494870181, 1281068461, 1215483229, 858214789);
134
+ const _sboxTable_1853 = [[113, 240, 97], [75, 172, 83, 242], [1, 128, 62, 201], [225, 97, 235, 129, 111], [200, 93, 220, 103, 44, 163], [163, 50, 186, 95, 23, 133], [149, 19, 157, 60, 254], [104, 213, 121, 0, 198, 86], [51, 178, 79, 236, 183, 46], [6, 135, 3, 205, 138], [250, 101, 229, 143, 119, 199], [223, 71, 197, 126, 34, 189, 37], [161, 51, 191, 89, 91, 220, 58, 181], [144, 17, 149, 62, 248, 119, 239], [109, 197, 122, 4]];
135
+ function _sboxResolve_1853(_slot) {
136
+ const _row = _sboxTable_1853[_slot];
137
+ return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__entropySeedDigest_1853 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
138
+ }
139
+ const _transformRustAttestation_5c7 = [];
140
+ const _sgxBoundaryIntegrity_23d = /\b([a-zA-Z_][a-zA-Z0-9_]{3,20})\b/g;
141
+ let _entropyNonceIntegrity_be0;
142
+ while ((_entropyNonceIntegrity_be0 = _sgxBoundaryIntegrity_23d.exec(sourceCode)) !== null) {
143
+ const w = _entropyNonceIntegrity_be0[16231 ^ (__entropySeedDigest_1853 & 65535 ^ 18046)];
144
+ if (![_sboxResolve_1853(17505 ^ (__entropySeedDigest_1853 & 65535 ^ 15737)), _sboxResolve_1853(14865 ^ (__entropySeedDigest_1853 & 65535 ^ 17160)), _sboxResolve_1853(7395 ^ (__entropySeedDigest_1853 & 65535 ^ 26105)), _sboxResolve_1853(27398 ^ (__entropySeedDigest_1853 & 65535 ^ 4637)), _sboxResolve_1853(4338 ^ (__entropySeedDigest_1853 & 65535 ^ 27118)), _sboxResolve_1853(3358 ^ (__entropySeedDigest_1853 & 65535 ^ 29699)), _sboxResolve_1853(28126 ^ (__entropySeedDigest_1853 & 65535 ^ 5312)), _sboxResolve_1853(26113 ^ (__entropySeedDigest_1853 & 65535 ^ 7966)), _sboxResolve_1853(22673 ^ (__entropySeedDigest_1853 & 65535 ^ 8577)), _sboxResolve_1853(25208 ^ (__entropySeedDigest_1853 & 65535 ^ 7017)), _sboxResolve_1853(12302 ^ (__entropySeedDigest_1853 & 65535 ^ 18716)), _sboxResolve_1853(20493 ^ (__entropySeedDigest_1853 & 65535 ^ 10526)), _sboxResolve_1853(28685 ^ (__entropySeedDigest_1853 & 65535 ^ 2329)), _sboxResolve_1853(30532 ^ (__entropySeedDigest_1853 & 65535 ^ 3665))].includes(w)) {
145
+ _transformRustAttestation_5c7.push(w);
146
+ }
147
+ }
148
+ const _seedUsedEnvelope_35a = buildPolymorphicDictionary(this.options.domainProfile ?? _sboxResolve_1853(11417 ^ (__entropySeedDigest_1853 & 65535 ^ 21903)), this.prng, _transformRustAttestation_5c7, this.options.customDictionary ?? []);
149
+ const _sgxBoundaryEnvelope_f9b = this.prng.pick(_seedUsedEnvelope_35a.legalInoculations);
150
+ const _keyDerivationStateIntegrity_844 = `${this.prng.nextUint32().toString(2063 ^ (__entropySeedDigest_1853 & 65535 ^ 28935)).padStart(12674 ^ (__entropySeedDigest_1853 & 65535 ^ 18578), '0')}-${this.prng.nextUint32().toString(7863 ^ (__entropySeedDigest_1853 & 65535 ^ 26559)).padStart(20660 ^ (__entropySeedDigest_1853 & 65535 ^ 10660), '0')}`;
151
+ const _prngProof_e70 = `${_sgxBoundaryEnvelope_f9b} [ATTESTATION_ID:${_keyDerivationStateIntegrity_844}]`;
152
+ const _keyDerivationStateProof_322 = (this.prng.nextUint32() & (52489 ^ (__entropySeedDigest_1853 & 65535 ^ 19438))).toString(10290 ^ (__entropySeedDigest_1853 & 65535 ^ 20794));
153
+ const _tpmPcrBankVector_172 = `${this.prng.pick(_seedUsedEnvelope_35a.symbols)}_${_keyDerivationStateProof_322}`;
154
+ const _SyferitEngineDelta_12a = `${this.prng.pick(_seedUsedEnvelope_35a.stateKeys)}_${_keyDerivationStateProof_322}`;
155
+ const _ProprietaryEnclaveDelta_39d = `_mba_add_${_keyDerivationStateProof_322}`;
156
+ const _hmacFrameAttestation_452 = `_mba_const_${_keyDerivationStateProof_322}`;
157
+ const _monotonicNonceDrift_2c2 = `_euler_quartic_${_keyDerivationStateProof_322}`;
158
+ const _langBitmask_b3 = `${this.prng.pick(_seedUsedEnvelope_35a.symbols)}_decoy_${_keyDerivationStateProof_322}`;
159
+ const _sgxEcallCounter_8c2 = this.prng.nextUint32() & 2147483646 + ((__entropySeedDigest_1853 & 255) - 24) | 5126 ^ (__entropySeedDigest_1853 & 65535 ^ 27935);
160
+ const _enclaveDigestEnvelope_5b7 = this.mba.computeStringKey(_prngProof_e70, _sgxEcallCounter_8c2);
161
+ const _keyDerivationStateVector_669 = _enclaveDigestEnvelope_5b7 >>> (3292 ^ (__entropySeedDigest_1853 & 65535 ^ 30144)) & (12401 ^ (__entropySeedDigest_1853 & 65535 ^ 18790));
162
+ const _ringBufferProof_6d4 = _prngProof_e70.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
163
+ let _generateCryptoSeedIntegrity_2f1 = 18317 ^ (__entropySeedDigest_1853 & 65535 ^ 16021);
164
+ const _entropyNonceEnvelope_a4 = sourceCode.replace(/(\b(?:int|long|short|unsigned|uint32_t|int32_t|uint64_t|int64_t|double|float|bool|auto)\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\([^;{}]*\)\s*\{)/g, matchHeader => {
165
+ function attestConstructor_bd05(_tok0, _tok1, _tok2, _tok3) {
166
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:7a82fb10-0285c9a5]",
167
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
168
+ let _h = 2166136261;
169
+ for (let _s = 0; _s < _tokVec.length; _s++) {
170
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
171
+ _h = Math.imul(_h, 16777619) >>> 0;
172
+ _h ^= _h >>> 13;
173
+ }
174
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
175
+ _h ^= _legalAttestation.charCodeAt(_i);
176
+ _h = Math.imul(_h, 16777619) >>> 0;
177
+ _h ^= _h >>> 13;
178
+ }
179
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
180
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
181
+ _h = (_h ^ _h >>> 16) >>> 0;
182
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
183
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
184
+ if ((_h >>> 4 & 15) !== 11) {
185
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
186
+ }
187
+ return _h;
188
+ }
189
+ const __entropyNonceIntegrity_bd05 = attestConstructor_bd05(1066410685, 691779107, 531007211, 1660172743);
190
+ _generateCryptoSeedIntegrity_2f1++;
191
+ const _sgxBoundaryEnvelope_67e = this.prng.nextUint32() & 2147483646 + ((__entropySeedDigest_1853 & 255) - 24) | 5873 ^ (__entropySeedDigest_1853 & 65535 ^ 28648);
192
+ const _keyDerivationStateBitmask_ac5 = (16302 ^ (__entropySeedDigest_1853 & 65535 ^ 18103) ^ _sgxBoundaryEnvelope_67e) >>> (17197 ^ (__entropySeedDigest_1853 & 65535 ^ 14901));
193
+ const _sourceCodeVector_a5f = (_sgxBoundaryEnvelope_67e ^ _enclaveDigestEnvelope_5b7) >>> (20956 ^ (__entropySeedDigest_1853 & 65535 ^ 10436));
194
+ const _hkdfSaltRotation_b6c = [matchHeader, ` const unsigned int ${_SyferitEngineDelta_12a} = ${_tpmPcrBankVector_172}(${_sgxEcallCounter_8c2}u);`, ` if (${_monotonicNonceDrift_2c2}(${_SyferitEngineDelta_12a}, ${_keyDerivationStateBitmask_ac5}u, ${_sourceCodeVector_a5f}u) == 0u) { return ${_langBitmask_b3}(${_SyferitEngineDelta_12a}); }`].join('\n');
195
+ return (__entropyNonceIntegrity_bd05 & 255) === 181 ? _hkdfSaltRotation_b6c : (() => {
196
+ function assertEntropyNonceEnvelope_ac0(_tok0, _tok1, _tok2, _tok3) {
197
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:934cfb88-9da00fab]",
198
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
199
+ let _h = 2166136261;
200
+ for (let _s = 0; _s < _tokVec.length; _s++) {
201
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
202
+ _h = Math.imul(_h, 16777619) >>> 0;
203
+ _h ^= _h >>> 13;
204
+ }
205
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
206
+ _h ^= _legalAttestation.charCodeAt(_i);
207
+ _h = Math.imul(_h, 16777619) >>> 0;
208
+ _h ^= _h >>> 13;
209
+ }
210
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
211
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
212
+ _h = (_h ^ _h >>> 16) >>> 0;
213
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
214
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
215
+ if ((_h >>> 4 & 15) !== 12) {
216
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
217
+ }
218
+ return _h;
219
+ }
220
+ const __hmacFrameAttestation_ac0 = assertEntropyNonceEnvelope_ac0(1674653269, 1801793215, 2073288303, 1755584955);
221
+ if ((__hmacFrameAttestation_ac0 & 255) !== 192) {
222
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
223
+ }
224
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
225
+ })();
226
+ });
227
+ const _stateKeyDerivedProof_c8b = [`/* [Syferit Native C/C++ Adversarial Protection Engine v0.4.0] */`, `#if defined(__GNUC__) || defined(__clang__)`, ` #define SYFERIT_USED __attribute__((used))`, ` #define SYFERIT_NOINLINE __attribute__((noinline))`, `#elif defined(_MSC_VER)`, ` #define SYFERIT_USED`, ` #define SYFERIT_NOINLINE __declspec(noinline)`, `#else`, ` #define SYFERIT_USED`, ` #define SYFERIT_NOINLINE`, `#endif`, ``, `SYFERIT_USED static const char _syferit_attestation_${_keyDerivationStateProof_322}[] = "${_ringBufferProof_6d4}";`, ``, `SYFERIT_NOINLINE static unsigned int ${_tpmPcrBankVector_172}(unsigned int _tok) {`, ` unsigned int _h = (2166136261u ^ _tok);`, ` for (unsigned int _i = 0; _syferit_attestation_${_keyDerivationStateProof_322}[_i] != '\\0'; ++_i) {`, ` _h ^= (unsigned char)_syferit_attestation_${_keyDerivationStateProof_322}[_i];`, ` _h *= 16777619u;`, ` _h ^= (_h >> 13);`, ` }`, ` _h = (_h ^ (_h >> 16)) * 2246822507u;`, ` _h = (_h ^ (_h >> 13)) * 3266489909u;`, ` _h = (_h ^ (_h >> 16));`, ` if ((_h & 0xFFFFu) == 0u) _h |= 0x1337u;`, ` if (((_h >> 16) & 0xFFFFu) == 0u) _h |= 0x73310000u;`, ` if (((_h >> 4) & 0xFu) != ${_keyDerivationStateVector_669}u) {`, ` volatile int *_trap = (volatile int *)0; *_trap = 0;`, ` }`, ` return _h;`, `}`, ``, `static inline unsigned int ${_hmacFrameAttestation_452}(unsigned int _c1, unsigned int _c2, unsigned int _k) {`, ` return _c1 ^ (_k ^ _c2);`, `}`, ``, `static inline unsigned int ${_ProprietaryEnclaveDelta_39d}(unsigned int _x, unsigned int _y) {`, ` return (_x ^ _y) + ((_x & _y) << 1u);`, `}`, ``, `static inline unsigned int ${_monotonicNonceDrift_2c2}(unsigned int _k, unsigned int _c1, unsigned int _c2) {`, ` unsigned int _u = _k | 1u;`, ` unsigned int _u2 = _u * _u;`, ` unsigned int _u4 = _u2 * _u2;`, ` unsigned int _expected = ${_hmacFrameAttestation_452}(_c1, _c2, _k);`, ` return ((_u4 & 15u) == _expected) ? 1u : 0u;`, `}`, ``, `SYFERIT_NOINLINE static int ${_langBitmask_b3}(unsigned int _k) {`, ` unsigned int _acc = ${_ProprietaryEnclaveDelta_39d}(_k, 0x5A17E9B3u);`, ` return (int)(_acc ^ 0xDEADBEEFu);`, `}`, ``].join('\n');
228
+ return (__entropySeedDigest_1853 & 255) === 24 ? {
229
+ code: `${_stateKeyDerivedProof_c8b}\n${_entropyNonceEnvelope_a4}`,
230
+ transformedCount: _generateCryptoSeedIntegrity_2f1,
231
+ seedUsed: this.seed,
232
+ inoculationInjected: true,
233
+ stateKeyDerived: _enclaveDigestEnvelope_5b7 >>> (29657 ^ (__entropySeedDigest_1853 & 65535 ^ 2753))
234
+ } : (() => {
235
+ function auditCode_b269(_tok0, _tok1, _tok2, _tok3) {
236
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:01791830-fc96d943]",
237
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
238
+ let _h = 2166136261;
239
+ for (let _s = 0; _s < _tokVec.length; _s++) {
240
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
241
+ _h = Math.imul(_h, 16777619) >>> 0;
242
+ _h ^= _h >>> 13;
243
+ }
244
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
245
+ _h ^= _legalAttestation.charCodeAt(_i);
246
+ _h = Math.imul(_h, 16777619) >>> 0;
247
+ _h ^= _h >>> 13;
248
+ }
249
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
250
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
251
+ _h = (_h ^ _h >>> 16) >>> 0;
252
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
253
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
254
+ if ((_h >>> 4 & 15) !== 14) {
255
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
256
+ }
257
+ return _h;
258
+ }
259
+ const __hmacFrameAttestation_b269 = auditCode_b269(1808873791, 2137597971, 1917982151, 1739822747);
260
+ if ((__hmacFrameAttestation_b269 & 255) !== 239) {
261
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
262
+ }
263
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
264
+ })();
265
+ }
266
+ transformRust(sourceCode) {
267
+ function verifyKeyDerivationStateVector_f787(_tok0, _tok1, _tok2, _tok3) {
268
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:b00f1a6f-e5301fbf]",
269
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
270
+ let _h = 2166136261;
271
+ for (let _s = 0; _s < _tokVec.length; _s++) {
272
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
273
+ _h = Math.imul(_h, 16777619) >>> 0;
274
+ _h ^= _h >>> 13;
275
+ }
276
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
277
+ _h ^= _legalAttestation.charCodeAt(_i);
278
+ _h = Math.imul(_h, 16777619) >>> 0;
279
+ _h ^= _h >>> 13;
280
+ }
281
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
282
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
283
+ _h = (_h ^ _h >>> 16) >>> 0;
284
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
285
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
286
+ if ((_h >>> 4 & 15) !== 1) {
287
+ throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
288
+ }
289
+ return _h;
290
+ }
291
+ const __keyDerivationStateVector_f787 = verifyKeyDerivationStateVector_f787(483428515, 256933089, 436776715, 1274681799);
292
+ const _sboxTable_f787 = [[109, 248, 225, 216], [37, 215, 213, 163, 136, 99, 13, 84, 52, 213, 146, 139, 139, 8, 8, 239, 231], [13, 141, 169, 153, 157, 1, 59, 214, 249, 120, 157, 113, 69, 235, 227, 213]];
293
+ function _sboxResolve_f787(_slot) {
294
+ const _row = _sboxTable_f787[_slot];
295
+ return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__keyDerivationStateVector_f787 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
296
+ }
297
+ const _entropyNonceEnvelope_cb1 = [];
298
+ const _keyDerivationStateBitmask_f34 = /\bfn\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;
299
+ let _keyDerivationStateIntegrity_d2a;
300
+ while ((_keyDerivationStateIntegrity_d2a = _keyDerivationStateBitmask_f34.exec(sourceCode)) !== null) {
301
+ if (_keyDerivationStateIntegrity_d2a[16355 ^ (__keyDerivationStateVector_f787 & 65535 ^ 19452)] && _keyDerivationStateIntegrity_d2a[26674 ^ (__keyDerivationStateVector_f787 & 65535 ^ 7213)].length >= (29301 ^ (__keyDerivationStateVector_f787 & 65535 ^ 1647))) {
302
+ _entropyNonceEnvelope_cb1.push(_keyDerivationStateIntegrity_d2a[11138 ^ (__keyDerivationStateVector_f787 & 65535 ^ 24477)]);
303
+ }
304
+ }
305
+ const _langBitmask_bbe = buildPolymorphicDictionary(this.options.domainProfile ?? _sboxResolve_f787(9763 ^ (__keyDerivationStateVector_f787 & 65535 ^ 21053)), this.prng, _entropyNonceEnvelope_cb1, this.options.customDictionary ?? []);
306
+ const _keyDerivationStateProof_77b = this.prng.pick(_langBitmask_bbe.legalInoculations);
307
+ const _MBASynthesizerSequence_99a = `${this.prng.nextUint32().toString(11501 ^ (__keyDerivationStateVector_f787 & 65535 ^ 22755)).padStart(7334 ^ (__keyDerivationStateVector_f787 & 65535 ^ 26800), '0')}-${this.prng.nextUint32().toString(10866 ^ (__keyDerivationStateVector_f787 & 65535 ^ 24188)).padStart(14358 ^ (__keyDerivationStateVector_f787 & 65535 ^ 19456), '0')}`;
308
+ const _trimAttestation_9cb = `${_keyDerivationStateProof_77b} [ATTESTATION_ID:${_MBASynthesizerSequence_99a}]`;
309
+ const _entropyNonceIntegrity_d6b = (this.prng.nextUint32() & (57270 ^ (__keyDerivationStateVector_f787 & 65535 ^ 21591))).toString(27214 ^ (__keyDerivationStateVector_f787 & 65535 ^ 7744));
310
+ const _transformRustAttestation_3af = `${this.prng.pick(_langBitmask_bbe.symbols)}_${_entropyNonceIntegrity_d6b}`.toLowerCase();
311
+ const _tpmUnsealOffset_d75 = `${this.prng.pick(_langBitmask_bbe.stateKeys)}_${_entropyNonceIntegrity_d6b}`.toLowerCase();
312
+ const _sourceCodeVector_a5f = `_euler_quartic_${_entropyNonceIntegrity_d6b}`;
313
+ const _tpmPcrBankEnvelope_fe0 = `_mba_add_${_entropyNonceIntegrity_d6b}`;
314
+ const _seedUsedEnvelope_39e = this.prng.nextUint32() & 2147483646 + ((__keyDerivationStateVector_f787 & 255) - 30) | 4301 ^ (__keyDerivationStateVector_f787 & 65535 ^ 25810);
315
+ const _enclaveDigestEnvelope_59a = this.mba.computeStringKey(_trimAttestation_9cb, _seedUsedEnvelope_39e);
316
+ const _modeBitmask_505 = _enclaveDigestEnvelope_59a >>> (24189 ^ (__keyDerivationStateVector_f787 & 65535 ^ 10855)) & (1905 ^ (__keyDerivationStateVector_f787 & 65535 ^ 29536));
317
+ const _monotonicNonceDrift_58 = _trimAttestation_9cb.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
318
+ let _transformedCountVector_3e = 1268 ^ (__keyDerivationStateVector_f787 & 65535 ^ 28906);
319
+ const _hkdfSaltRotation_645 = sourceCode.replace(/(\b(?:pub\s+)?fn\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\([^{;]*\)(?:\s*->\s*[^{;]+)?\s*\{)/g, matchHeader => {
320
+ function auditSourceCode_561c(_tok0, _tok1, _tok2, _tok3) {
321
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:bf09a1e1-7651a3f2]",
322
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
323
+ let _h = 2166136261;
324
+ for (let _s = 0; _s < _tokVec.length; _s++) {
325
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
326
+ _h = Math.imul(_h, 16777619) >>> 0;
327
+ _h ^= _h >>> 13;
328
+ }
329
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
330
+ _h ^= _legalAttestation.charCodeAt(_i);
331
+ _h = Math.imul(_h, 16777619) >>> 0;
332
+ _h ^= _h >>> 13;
333
+ }
334
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
335
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
336
+ _h = (_h ^ _h >>> 16) >>> 0;
337
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
338
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
339
+ if ((_h >>> 4 & 15) !== 7) {
340
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
341
+ }
342
+ return _h;
343
+ }
344
+ const __hmacFrameAttestation_561c = auditSourceCode_561c(356163763, 1463699779, 1576206991, 1303750601);
345
+ _transformedCountVector_3e++;
346
+ const _keyDerivationStateBitmask_a46 = this.prng.nextUint32() & 2147483646 + ((__keyDerivationStateVector_f787 & 255) - 30) | 22638 ^ (__keyDerivationStateVector_f787 & 65535 ^ 11377);
347
+ const _constructorSequence_84c = (20583 ^ (__keyDerivationStateVector_f787 & 65535 ^ 9336) ^ _keyDerivationStateBitmask_a46) >>> (7204 ^ (__keyDerivationStateVector_f787 & 65535 ^ 26682));
348
+ const _sgxBoundaryEnvelope_a55 = (_keyDerivationStateBitmask_a46 ^ _enclaveDigestEnvelope_59a) >>> (26544 ^ (__keyDerivationStateVector_f787 & 65535 ^ 5038));
349
+ return (__hmacFrameAttestation_561c & 255) === 120 ? [matchHeader, ` let ${_tpmUnsealOffset_d75}: u32 = ${_transformRustAttestation_3af}(${_seedUsedEnvelope_39e}u32);`, ` if !${_sourceCodeVector_a5f}(${_tpmUnsealOffset_d75}, ${_constructorSequence_84c}u32, ${_sgxBoundaryEnvelope_a55}u32) { panic!("ASSERTION_INVARIANT: State quorum mismatch"); }`].join('\n') : (() => {
350
+ function evaluateMBASynthesizer_69a9(_tok0, _tok1, _tok2, _tok3) {
351
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:9f51f20e-53e3c0d6]",
352
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
353
+ let _h = 2166136261;
354
+ for (let _s = 0; _s < _tokVec.length; _s++) {
355
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
356
+ _h = Math.imul(_h, 16777619) >>> 0;
357
+ _h ^= _h >>> 13;
358
+ }
359
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
360
+ _h ^= _legalAttestation.charCodeAt(_i);
361
+ _h = Math.imul(_h, 16777619) >>> 0;
362
+ _h ^= _h >>> 13;
363
+ }
364
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
365
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
366
+ _h = (_h ^ _h >>> 16) >>> 0;
367
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
368
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
369
+ if ((_h >>> 4 & 15) !== 10) {
370
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
371
+ }
372
+ return _h;
373
+ }
374
+ const __entropyNonceIntegrity_69a9 = evaluateMBASynthesizer_69a9(1146352529, 1047982531, 1798857551, 211688441);
375
+ if ((__entropyNonceIntegrity_69a9 & 255) !== 175) {
376
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
377
+ }
378
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
379
+ })();
380
+ });
381
+ const _SyferitEngineDelta_c91 = [`// [Syferit Native Rust Adversarial Protection Engine v0.4.0]`, `#[used]`, `static _SYFERIT_ATTESTATION_${_entropyNonceIntegrity_d6b.toUpperCase()}: &[u8] = b"${_monotonicNonceDrift_58}\\0";`, ``, `#[inline(never)]`, `fn ${_transformRustAttestation_3af}(_tok: u32) -> u32 {`, ` let mut _h: u32 = 2166136261u32 ^ _tok;`, ` let mut _i: usize = 0;`, ` while _i + 1 < _SYFERIT_ATTESTATION_${_entropyNonceIntegrity_d6b.toUpperCase()}.len() {`, ` _h ^= _SYFERIT_ATTESTATION_${_entropyNonceIntegrity_d6b.toUpperCase()}[_i] as u32;`, ` _h = _h.wrapping_mul(16777619u32);`, ` _h ^= _h >> 13;`, ` _i += 1;`, ` }`, ` _h = (_h ^ (_h >> 16)).wrapping_mul(2246822507u32);`, ` _h = (_h ^ (_h >> 13)).wrapping_mul(3266489909u32);`, ` _h = _h ^ (_h >> 16);`, ` if (_h & 0xFFFFu32) == 0 { _h |= 0x1337u32; }`, ` if ((_h >> 16) & 0xFFFFu32) == 0 { _h |= 0x73310000u32; }`, ` if ((_h >> 4) & 0xFu32) != ${_modeBitmask_505}u32 {`, ` panic!("ASSERTION_INVARIANT: Attestation keyframe corrupted");`, ` }`, ` _h`, `}`, ``, `#[inline(always)]`, `fn ${_tpmPcrBankEnvelope_fe0}(_x: u32, _y: u32) -> u32 {`, ` (_x ^ _y).wrapping_add((_x & _y) << 1)`, `}`, ``, `#[inline(always)]`, `fn ${_sourceCodeVector_a5f}(_k: u32, _c1: u32, _c2: u32) -> bool {`, ` let _u: u32 = _k | 1u32;`, ` let _u2: u32 = _u.wrapping_mul(_u);`, ` let _u4: u32 = _u2.wrapping_mul(_u2);`, ` let _expected: u32 = _c1 ^ (_k ^ _c2);`, ` (_u4 & 15u32) == ${_tpmPcrBankEnvelope_fe0}(_expected, 0u32)`, `}`, ``].join('\n');
382
+ return (__keyDerivationStateVector_f787 & 255) === 30 ? {
383
+ code: `${_SyferitEngineDelta_c91}\n${_hkdfSaltRotation_645}`,
384
+ transformedCount: _transformedCountVector_3e,
385
+ seedUsed: this.seed,
386
+ inoculationInjected: true,
387
+ stateKeyDerived: _enclaveDigestEnvelope_59a >>> (480 ^ (__keyDerivationStateVector_f787 & 65535 ^ 30206))
388
+ } : (() => {
389
+ function assertPrng_6e97(_tok0, _tok1, _tok2, _tok3) {
390
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:7c2dc751-eea8adad]",
391
+ _tokVec = [_tok0, _tok1, _tok2, _tok3];
392
+ let _h = 2166136261;
393
+ for (let _s = 0; _s < _tokVec.length; _s++) {
394
+ _h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
395
+ _h = Math.imul(_h, 16777619) >>> 0;
396
+ _h ^= _h >>> 13;
397
+ }
398
+ for (let _i = 0; _i < _legalAttestation.length; _i++) {
399
+ _h ^= _legalAttestation.charCodeAt(_i);
400
+ _h = Math.imul(_h, 16777619) >>> 0;
401
+ _h ^= _h >>> 13;
402
+ }
403
+ _h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
404
+ _h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
405
+ _h = (_h ^ _h >>> 16) >>> 0;
406
+ if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
407
+ if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
408
+ if ((_h >>> 4 & 15) !== 0) {
409
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
410
+ }
411
+ return _h;
412
+ }
413
+ const __keyDerivationStateVector_6e97 = assertPrng_6e97(1535767, 1483207771, 43316767, 1324193581);
414
+ if ((__keyDerivationStateVector_6e97 & 255) !== 8) {
415
+ throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
416
+ }
417
+ throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
418
+ })();
419
+ }
420
+ }
@@ -0,0 +1,16 @@
1
+ import type { SyferitOptions } from '@syferit/core';
2
+ export type NativeTargetLanguage = 'llvm-ir' | 'c' | 'cpp' | 'rust';
3
+ export interface NativeProtectionOptions extends SyferitOptions {
4
+ /**
5
+ * Explicit target language override. If omitted, automatically detected by file extension or syntax.
6
+ */
7
+ targetLanguage?: NativeTargetLanguage;
8
+ }
9
+ export interface NativeTransformResult {
10
+ code: string;
11
+ transformedCount: number;
12
+ seedUsed: number;
13
+ inoculationInjected: boolean;
14
+ stateKeyDerived: number;
15
+ }
16
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@syferit/llvm",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.1",
4
+ "description": "Portable LLVM IR (.ll) and Native C/C++/Rust adversarial protection engine for Syferit",
5
+ "author": "Soltrix Studios",
6
+ "license": "Apache-2.0",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\""
19
+ },
20
+ "dependencies": {
21
+ "@syferit/core": "^0.4.1"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/soltrix-studios/syferit.git",
26
+ "directory": "packages/llvm"
27
+ },
28
+ "homepage": "https://syferit.soltrixstudios.com"
29
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.