@syferit/llvm 0.4.4 → 0.4.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 +11 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -140
- package/package.json +2 -2
- package/dist/irTransformer.js +0 -420
- package/dist/nativeSourceTransformer.js +0 -372
- package/dist/types.js +0 -8
package/README.md
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://syferit.soltrixstudios.com">
|
|
3
|
+
<img src="../../assets/icon.png" alt="Syferit Logo" width="80" height="80" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<h1 align="center">@syferit/llvm</h1>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Native C/C++/Rust/Zig LLVM IR Protection & Compiler Pass</strong><br>
|
|
11
|
+
<em>“Don't Just Ship it. Syferit.”</em>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
> Part of the **[Syferit](https://syferit.soltrixstudios.com)** code defense framework by **[Soltrix Studios](https://soltrixstudios.com)**.
|
|
8
15
|
|
|
9
16
|
---
|
|
10
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [Protected by Soltrix Studios
|
|
1
|
+
// [Protected by Soltrix Studios | Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
2
|
import type { SyferitOptions } from '@syferit/core';
|
|
3
3
|
export type NativeTargetLanguage = 'llvm-ir' | 'c' | 'cpp' | 'rust';
|
|
4
4
|
export interface NativeProtectionOptions extends SyferitOptions {
|
package/dist/index.js
CHANGED
|
@@ -1,140 +1,15 @@
|
|
|
1
|
-
// [Protected by Soltrix Studios
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
18
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
19
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
20
|
-
_h ^= _h >>> 13;
|
|
21
|
-
}
|
|
22
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
23
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
24
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
25
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
26
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
27
|
-
if ((_h >>> 4 & 15) !== 4) {
|
|
28
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
29
|
-
}
|
|
30
|
-
return _h;
|
|
31
|
-
}
|
|
32
|
-
const __keyDerivationStateSequence_ec37 = auditRingBufferProof_ec37(1368607557, 120164079, 157399957, 965331789);
|
|
33
|
-
const _keyDerivationStateBitmask_39f = new LlvmIrTransformer(options);
|
|
34
|
-
return (__keyDerivationStateSequence_ec37 & 255) === 65 ? _keyDerivationStateBitmask_39f.transform(irCode) : (() => {
|
|
35
|
-
function assertRingBufferIntegrity_6f7a(_tok0, _tok1, _tok2, _tok3) {
|
|
36
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:20f3b8d0-9ae96534]",
|
|
37
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
38
|
-
let _h = 2166136261;
|
|
39
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
40
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
41
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
42
|
-
_h ^= _h >>> 13;
|
|
43
|
-
}
|
|
44
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
45
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
46
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
47
|
-
_h ^= _h >>> 13;
|
|
48
|
-
}
|
|
49
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
50
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
51
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
52
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
53
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
54
|
-
if ((_h >>> 4 & 15) !== 2) {
|
|
55
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
56
|
-
}
|
|
57
|
-
return _h;
|
|
58
|
-
}
|
|
59
|
-
const __keyDerivationStateBitmask_6f7a = assertRingBufferIntegrity_6f7a(1319905289, 875373949, 1204028363, 614747439);
|
|
60
|
-
if ((__keyDerivationStateBitmask_6f7a & 255) !== 44) {
|
|
61
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
62
|
-
}
|
|
63
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
64
|
-
})();
|
|
65
|
-
}
|
|
66
|
-
export function protectNativeSource(sourceCode, options) {
|
|
67
|
-
function evaluateSourceCode_1bb7(_tok0, _tok1, _tok2, _tok3) {
|
|
68
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:fbfd7be7-113e9ec0]",
|
|
69
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
70
|
-
let _h = 2166136261;
|
|
71
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
72
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
73
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
74
|
-
_h ^= _h >>> 13;
|
|
75
|
-
}
|
|
76
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
77
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
78
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
79
|
-
_h ^= _h >>> 13;
|
|
80
|
-
}
|
|
81
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
82
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
83
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
84
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
85
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
86
|
-
if ((_h >>> 4 & 15) !== 3) {
|
|
87
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
88
|
-
}
|
|
89
|
-
return _h;
|
|
90
|
-
}
|
|
91
|
-
const __tpmPcrBankVector_1bb7 = evaluateSourceCode_1bb7(586511261, 747686377, 1519713813, 804238385);
|
|
92
|
-
const _keyDerivationStateBitmask_1bb7 = [[89, 205, 85], [57, 139, 58, 19, 172, 71, 234, 196, 216, 57, 45, 251, 111, 236, 111, 127, 219], [225, 105, 12, 233, 121, 237, 102, 70, 197, 92, 248, 193, 33, 183, 78, 37]];
|
|
93
|
-
function _verifyEnclaveDigestSequence_1bb7(_slot) {
|
|
94
|
-
const _row = _keyDerivationStateBitmask_1bb7[_slot];
|
|
95
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__tpmPcrBankVector_1bb7 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
96
|
-
}
|
|
97
|
-
const _hmacFrameIntegrity_a00 = options?.targetLanguage ?? _verifyEnclaveDigestSequence_1bb7(33628 ^ (__tpmPcrBankVector_1bb7 & 65535 ^ 7014));
|
|
98
|
-
const _SoltrixStudiosDelta_151 = new NativeSourceTransformer(options);
|
|
99
|
-
return (__tpmPcrBankVector_1bb7 & 255) === 58 ? _SoltrixStudiosDelta_151.transform(sourceCode, _hmacFrameIntegrity_a00) : (() => {
|
|
100
|
-
function attestKernelStateNonce_9ba4(_tok0, _tok1, _tok2, _tok3) {
|
|
101
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:9851073e-6e880a69]",
|
|
102
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
103
|
-
let _h = 2166136261;
|
|
104
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
105
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
106
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
107
|
-
_h ^= _h >>> 13;
|
|
108
|
-
}
|
|
109
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
110
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
111
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
112
|
-
_h ^= _h >>> 13;
|
|
113
|
-
}
|
|
114
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
115
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
116
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
117
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
118
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
119
|
-
if ((_h >>> 4 & 15) !== 6) {
|
|
120
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
121
|
-
}
|
|
122
|
-
return _h;
|
|
123
|
-
}
|
|
124
|
-
const __keyDerivationStateBitmask_9ba4 = attestKernelStateNonce_9ba4(1902536873, 1163078895, 1498062035, 2049343819);
|
|
125
|
-
if ((__keyDerivationStateBitmask_9ba4 & 255) !== 96) {
|
|
126
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
127
|
-
}
|
|
128
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
129
|
-
})();
|
|
130
|
-
}
|
|
131
|
-
if (typeof window !== "undefined") {
|
|
132
|
-
window.__syferitIPC_77e4.invoke && window.__syferitIPC_77e4.invoke("license:quorum-token-refresh", {
|
|
133
|
-
syncEpoch: 20323504,
|
|
134
|
-
channelSig: "SIG_FRAME_77E4"
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
const __syferitDispatch_af73 = [protectLlvmIr, protectNativeSource];
|
|
138
|
-
function __invoke___syferitDispatch_af73(_targetIdx, _seed) {
|
|
139
|
-
return __syferitDispatch_af73[_targetIdx + ((Math.imul(Math.imul(_seed ^ 1195, 33213) | 1, Math.imul(_seed ^ 1195, 33213) | 1) & 7) - 1)];
|
|
140
|
-
}
|
|
1
|
+
// [Protected by Soltrix Studios | Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
|
+
import{SeededPRNG as M,MBASynthesizer as lt,buildPolymorphicDictionary as dt}from"@syferit/core";var j=class{options;prng;mba;seed;constructor(t={}){this.options=t,this.seed=typeof t.seed=="number"?t.seed:typeof t.seed=="string"&&t.seed.trim()!==""?M.hashString(t.seed):M.generateCryptoSeed(),this.prng=new M(this.seed),this.mba=new lt(this.prng)}transform(t){if(this.options.mode==="development")return{code:t,transformedCount:0,seedUsed:this.seed,inoculationInjected:!1,stateKeyDerived:0};let o=t.replace(/^\s*;.*$/gm,""),u=[],F=/define\s+[^@]*@([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g,r;for(;(r=F.exec(o))!==null;)r[1]&&r[1].length>=4&&u.push(r[1]);let a=dt(this.options.domainProfile??"saas",this.prng,u,this.options.customDictionary??[]),v=this.prng.pick(a.legalInoculations),E=`${this.prng.nextUint32().toString(16).padStart(8,"0")}-${this.prng.nextUint32().toString(16).padStart(8,"0")}`,$=`${v} [ATTESTATION_ID:${E}]`,s=(this.prng.nextUint32()&65535).toString(16),p=`${this.prng.pick(a.symbols)}_${s}`,h=`${this.prng.pick(a.stateKeys)}_${s}`,l=this.prng.nextUint32()&2147483646|1,_=this.mba.computeStringKey($,l),g=_>>>4&15,c=0,I=1,x=o.replace(/(define\s+[^@{]+@[a-zA-Z0-9_$.]+\s*\([^)]*\)[^{]*\{)([\s\S]*?)(\n\})/g,(q,O,L,H)=>{c++;let K=`%${h}_k${c}`,G=L.match(/^(\s*[a-zA-Z0-9_$.]+:\s*\n)/),X=`
|
|
3
|
+
${K} = call i32 @${p}(i32 ${l})
|
|
4
|
+
`,Q=L.replace(/^(\s*)(%[a-zA-Z0-9_$.]+)\s*=\s*(add|sub|xor)(?:\s+nsw|\s+nuw)*\s+i32\s+([^,\n]+),\s*([^\n]+)$/gm,(B,n,Y,J,_t,ct)=>{let y=_t.trim(),d=ct.trim(),i=I++,e=[];if(/^-?\d+$/.test(d)){let S=parseInt(d,10)|0,m=this.prng.nextUint32()&2147483646|1,b=S^m|0,k=m^_|0,z=`%_m_kxor_${i}`,A=`%_m_const_${i}`;e.push(`${n}${z} = xor i32 ${K}, ${k}`),e.push(`${n}${A} = xor i32 ${b}, ${z}`),d=A}if(J==="add"){let S=`%_m_axor_${i}`,m=`%_m_aand_${i}`,b=`%_m_ashl_${i}`,k=`%_m_abase_${i}`,z=`%_m_u0_${i}`,A=`%_m_u1_${i}`,P=`%_m_u2_${i}`,et=`%_m_u4_${i}`,nt=`%_m_q1_${i}`,st=`%_m_ko1_${i}`,it=`%_m_ko2_${i}`,ot=`%_m_zinv_${i}`,rt=this.prng.nextUint32()&2147483646|1,ut=1^rt|0,$t=rt^_|0;return e.push(`${n}${S} = xor i32 ${y}, ${d}`),e.push(`${n}${m} = and i32 ${y}, ${d}`),e.push(`${n}${b} = shl i32 ${m}, 1`),e.push(`${n}${k} = add i32 ${S}, ${b}`),e.push(`${n}${z} = xor i32 ${y}, ${K}`),e.push(`${n}${A} = or i32 ${z}, 1`),e.push(`${n}${P} = mul i32 ${A}, ${A}`),e.push(`${n}${et} = mul i32 ${P}, ${P}`),e.push(`${n}${nt} = and i32 ${et}, 15`),e.push(`${n}${st} = xor i32 ${K}, ${$t}`),e.push(`${n}${it} = xor i32 ${ut}, ${st}`),e.push(`${n}${ot} = xor i32 ${nt}, ${it}`),e.push(`${n}${Y} = add i32 ${k}, ${ot}`),e.join(`
|
|
5
|
+
`)}if(J==="sub"){let S=`%_m_sxor_${i}`,m=`%_m_snot_${i}`,b=`%_m_sand_${i}`,k=`%_m_sshl_${i}`;return e.push(`${n}${S} = xor i32 ${y}, ${d}`),e.push(`${n}${m} = xor i32 ${y}, -1`),e.push(`${n}${b} = and i32 ${m}, ${d}`),e.push(`${n}${k} = shl i32 ${b}, 1`),e.push(`${n}${Y} = sub i32 ${S}, ${k}`),e.join(`
|
|
6
|
+
`)}let W=`%_m_xor_or_${i}`,tt=`%_m_xor_and_${i}`;return e.push(`${n}${W} = or i32 ${y}, ${d}`),e.push(`${n}${tt} = and i32 ${y}, ${d}`),e.push(`${n}${Y} = sub i32 ${W}, ${tt}`),e.join(`
|
|
7
|
+
`)});if(G){let B=G[1],n=Q.slice(B.length);return`${O}${B}${X}${n}${H}`}return`${O}${X}${Q}${H}`});if(c===0)return{code:t,transformedCount:0,seedUsed:this.seed,inoculationInjected:!1,stateKeyDerived:0};let D=Buffer.from($,"utf-8").length+1,C=$.replace(/\\/g,"\\\\").replace(/"/g,"\\22"),N=1511516595,R=l^N|0,f=(_|0)-R|0;return{code:`${["; [Protected by Soltrix Studios \u2014 Syferit Code Defense Engine | https://syferit.soltrixstudios.com]",`@.syferit.legal.attestation_${s} = private unnamed_addr constant [${D} x i8] c"${C}\\00", align 1`,`@llvm.compiler.used = appending global [1 x ptr] [ptr @.syferit.legal.attestation_${s}], section "llvm.metadata"`,"","declare void @llvm.trap() #0","",`define internal i32 @${p}(i32 %_tok) noinline optnone {`,"entry:",` %_att_byte = load volatile i8, ptr @.syferit.legal.attestation_${s}, align 1`," %_att_valid = icmp ne i8 %_att_byte, 0",` %_x0 = xor i32 %_tok, ${N}`,` %_key = add i32 %_x0, ${f}`," %_shr = lshr i32 %_key, 4"," %_nib = and i32 %_shr, 15",` %_nib_ok = icmp eq i32 %_nib, ${g}`," %_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(`
|
|
8
|
+
`)}
|
|
9
|
+
${x}`,transformedCount:c,seedUsed:this.seed,inoculationInjected:!0,stateKeyDerived:_>>>0}}};import{SeededPRNG as V,MBASynthesizer as pt,buildPolymorphicDictionary as at}from"@syferit/core";var Z=class{options;prng;mba;seed;constructor(t={}){this.options=t,this.seed=typeof t.seed=="number"?t.seed:typeof t.seed=="string"&&t.seed.trim()!==""?V.hashString(t.seed):V.generateCryptoSeed(),this.prng=new V(this.seed),this.mba=new pt(this.prng)}transform(t,o="cpp"){return this.options.mode==="development"?{code:t,transformedCount:0,seedUsed:this.seed,inoculationInjected:!1,stateKeyDerived:0}:o==="rust"?this.transformRust(t):this.transformCCpp(t)}transformCCpp(t){let o=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(?<!:)\/\/.*$/gm,""),u=[],F=/\b([a-zA-Z_][a-zA-Z0-9_]{3,20})\b/g,r;for(;(r=F.exec(o))!==null;){let f=r[1];["int","void","char","float","double","return","const","static","struct","class","public","private","uint32_t","include"].includes(f)||u.push(f)}let a=at(this.options.domainProfile??"saas",this.prng,u,this.options.customDictionary??[]),v=this.prng.pick(a.legalInoculations),E=`${this.prng.nextUint32().toString(16).padStart(8,"0")}-${this.prng.nextUint32().toString(16).padStart(8,"0")}`,$=`${v} [ATTESTATION_ID:${E}]`,s=(this.prng.nextUint32()&65535).toString(16),p=`${this.prng.pick(a.symbols)}_${s}`,h=`${this.prng.pick(a.stateKeys)}_${s}`,l=`_fold_carry_${s}`,_=`_unmask_scalar_${s}`,g=`_verify_quorum_${s}`,c=`${this.prng.pick(a.symbols)}_decoy_${s}`,I=this.prng.nextUint32()&2147483646|1,x=this.mba.computeStringKey($,I),U=x>>>4&15,D=$.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),C=0,N=o.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,f=>{C++;let w=this.prng.nextUint32()&2147483646|1,q=(1^w)>>>0,O=(w^x)>>>0;return[f,` const unsigned int ${h} = ${p}(${I}u);`,` if (${g}(${h}, ${q}u, ${O}u) == 0u) { return ${c}(${h}); }`].join(`
|
|
10
|
+
`)});return{code:`${["/* [Protected by Soltrix Studios \u2014 Syferit Code Defense Engine | https://syferit.soltrixstudios.com] */","#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_${s}[] = "${D}";`,"",`SYFERIT_NOINLINE static unsigned int ${p}(unsigned int _tok) {`," unsigned int _h = (2166136261u ^ _tok);",` for (unsigned int _i = 0; _syferit_attestation_${s}[_i] != '\\0'; ++_i) {`,` _h ^= (unsigned char)_syferit_attestation_${s}[_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) != ${U}u) {`," volatile int *_trap = (volatile int *)0; *_trap = 0;"," }"," return _h;","}","",`static inline unsigned int ${_}(unsigned int _c1, unsigned int _c2, unsigned int _k) {`," return _c1 ^ (_k ^ _c2);","}","",`static inline unsigned int ${l}(unsigned int _x, unsigned int _y) {`," return (_x ^ _y) + ((_x & _y) << 1u);","}","",`static inline unsigned int ${g}(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 = ${_}(_c1, _c2, _k);`," return ((_u4 & 15u) == _expected) ? 1u : 0u;","}","",`SYFERIT_NOINLINE static int ${c}(unsigned int _k) {`,` unsigned int _acc = ${l}(_k, 0x5A17E9B3u);`," return (int)(_acc ^ 0xDEADBEEFu);","}",""].join(`
|
|
11
|
+
`)}
|
|
12
|
+
${N}`,transformedCount:C,seedUsed:this.seed,inoculationInjected:!0,stateKeyDerived:x>>>0}}transformRust(t){let o=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(?<!:)\/\/.*$/gm,""),u=[],F=/\bfn\s+([a-zA-Z_][a-zA-Z0-9_]*)/g,r;for(;(r=F.exec(o))!==null;)r[1]&&r[1].length>=4&&u.push(r[1]);let a=at(this.options.domainProfile??"saas",this.prng,u,this.options.customDictionary??[]),v=this.prng.pick(a.legalInoculations),E=`${this.prng.nextUint32().toString(16).padStart(8,"0")}-${this.prng.nextUint32().toString(16).padStart(8,"0")}`,$=`${v} [ATTESTATION_ID:${E}]`,s=(this.prng.nextUint32()&65535).toString(16),p=`${this.prng.pick(a.symbols)}_${s}`.toLowerCase(),h=`${this.prng.pick(a.stateKeys)}_${s}`.toLowerCase(),l=`_verify_quorum_${s}`,_=`_fold_carry_${s}`,g=this.prng.nextUint32()&2147483646|1,c=this.mba.computeStringKey($,g),I=c>>>4&15,x=$.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),U=0,D=o.replace(/(\b(?:pub\s+)?fn\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\([^{;]*\)(?:\s*->\s*[^{;]+)?\s*\{)/g,N=>{U++;let R=this.prng.nextUint32()&2147483646|1,f=(1^R)>>>0,w=(R^c)>>>0;return[N,` let ${h}: u32 = ${p}(${g}u32);`,` if !${l}(${h}, ${f}u32, ${w}u32) { panic!("ASSERTION_INVARIANT: State quorum mismatch"); }`].join(`
|
|
13
|
+
`)});return{code:`${["// [Protected by Soltrix Studios \u2014 Syferit Code Defense Engine | https://syferit.soltrixstudios.com]","#[used]",`static _SYFERIT_ATTESTATION_${s.toUpperCase()}: &[u8] = b"${x}\\0";`,"","#[inline(never)]",`fn ${p}(_tok: u32) -> u32 {`," let mut _h: u32 = 2166136261u32 ^ _tok;"," let mut _i: usize = 0;",` while _i + 1 < _SYFERIT_ATTESTATION_${s.toUpperCase()}.len() {`,` _h ^= _SYFERIT_ATTESTATION_${s.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) != ${I}u32 {`,' panic!("ASSERTION_INVARIANT: Attestation keyframe corrupted");'," }"," _h","}","","#[inline(always)]",`fn ${_}(_x: u32, _y: u32) -> u32 {`," (_x ^ _y).wrapping_add((_x & _y) << 1)","}","","#[inline(always)]",`fn ${l}(_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) == ${_}(_expected, 0u32)`,"}",""].join(`
|
|
14
|
+
`)}
|
|
15
|
+
${D}`,transformedCount:U,seedUsed:this.seed,inoculationInjected:!0,stateKeyDerived:c>>>0}}};function St(T,t){return new j(t).transform(T)}function bt(T,t){let o=t?.targetLanguage??"cpp";return new Z(t).transform(T,o)}export{j as LlvmIrTransformer,Z as NativeSourceTransformer,St as protectLlvmIr,bt as protectNativeSource};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syferit/llvm",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Portable LLVM IR (.ll) and Native C/C++/Rust adversarial protection engine for Syferit",
|
|
5
5
|
"author": "Soltrix Studios",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@syferit/core": "^0.4.
|
|
21
|
+
"@syferit/core": "^0.4.6"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
package/dist/irTransformer.js
DELETED
|
@@ -1,420 +0,0 @@
|
|
|
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(rawIrCode) {
|
|
14
|
-
function unsealMBASynthesizer_aeff(_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:b83d16ec-63cbf83f]",
|
|
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) !== 5) {
|
|
34
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
35
|
-
}
|
|
36
|
-
return _h;
|
|
37
|
-
}
|
|
38
|
-
const __enclaveDigestSequence_aeff = unsealMBASynthesizer_aeff(1132396427, 1261691285, 89362837, 1064025629);
|
|
39
|
-
const _entropyNonceProof_aeff = [[49, 77, 66, 72, 137, 193, 208, 231, 21, 56, 38, 32, 113, 171, 184, 132], [29, 45, 48, 44, 97, 179, 170, 176, 196, 30, 26], [246, 30, 6, 49, 67, 116, 144, 112, 179, 248, 204, 250, 53, 74, 76, 79, 138], [176, 243, 241, 224], [128, 196, 216, 231, 13, 62, 38, 62, 101, 178, 130, 140, 203, 16, 26, 17, 92], [108, 184, 190], [84, 104, 143, 113, 153, 164, 167, 166, 5, 26, 120, 89, 154, 207, 210, 221, 246], [49, 79, 84, 84, 180, 139, 140, 139, 32, 125, 19, 60, 103, 144, 137, 128, 211], [15, 62, 43], [196, 30, 13, 29, 84, 114, 103, 90, 160, 235, 249, 245, 60, 88, 79, 73], [179, 225, 245, 187, 98], [183, 136, 138]];
|
|
40
|
-
function _auditMode_aeff(_slot) {
|
|
41
|
-
const _row = _entropyNonceProof_aeff[_slot];
|
|
42
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__enclaveDigestSequence_aeff >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
43
|
-
}
|
|
44
|
-
if (this.options.mode === _auditMode_aeff(57746 ^ (__enclaveDigestSequence_aeff & 65535 ^ 8134)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 73 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 73 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 73 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 73 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 17 & 255 ^ 190)) === 82) {
|
|
45
|
-
return {
|
|
46
|
-
code: rawIrCode,
|
|
47
|
-
transformedCount: (65238 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535),
|
|
48
|
-
seedUsed: this.seed,
|
|
49
|
-
inoculationInjected: false,
|
|
50
|
-
stateKeyDerived: (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535)
|
|
51
|
-
};
|
|
52
|
-
} else if (this.options.mode === _auditMode_aeff(33049 ^ (__enclaveDigestSequence_aeff & 65535 ^ 32588)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 18 & 255 ^ 24)) === 108) {
|
|
53
|
-
return {
|
|
54
|
-
code: rawIrCode,
|
|
55
|
-
transformedCount: 34925 ^ (__enclaveDigestSequence_aeff & 65535 ^ 30265),
|
|
56
|
-
seedUsed: this.seed,
|
|
57
|
-
inoculationInjected: false,
|
|
58
|
-
stateKeyDerived: 48333 ^ (__enclaveDigestSequence_aeff & 65535 ^ 17049)
|
|
59
|
-
};
|
|
60
|
-
} else if (this.options.mode === _auditMode_aeff(33925 ^ (__enclaveDigestSequence_aeff & 65535 ^ 31443)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 46 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 46 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 46 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 46 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 2 & 255 ^ 54)) === 174) {
|
|
61
|
-
return {
|
|
62
|
-
code: rawIrCode,
|
|
63
|
-
transformedCount: (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535),
|
|
64
|
-
seedUsed: this.seed,
|
|
65
|
-
inoculationInjected: false,
|
|
66
|
-
stateKeyDerived: (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const _seedProof_aab = rawIrCode.replace(/^\s*;.*$/gm, '');
|
|
70
|
-
const _ProprietaryEnclaveDelta_4c5 = [];
|
|
71
|
-
const _hmacFrameBitmask_40f = /define\s+[^@]*@([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g;
|
|
72
|
-
let _tpmUnsealOffset_d47;
|
|
73
|
-
while ((_tpmUnsealOffset_d47 = _hmacFrameBitmask_40f.exec(_seedProof_aab)) !== null) {
|
|
74
|
-
if (_tpmUnsealOffset_d47[38003 ^ (__enclaveDigestSequence_aeff & 65535 ^ 27174)] && _tpmUnsealOffset_d47[43806 ^ (__enclaveDigestSequence_aeff & 65535 ^ 21835)].length >= (40251 ^ (__enclaveDigestSequence_aeff & 65535 ^ 25451))) {
|
|
75
|
-
_ProprietaryEnclaveDelta_4c5.push(_tpmUnsealOffset_d47[54874 ^ (__enclaveDigestSequence_aeff & 65535 ^ 10255)]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const _inoculationInjectedProof_227 = buildPolymorphicDictionary(this.options.domainProfile ?? _auditMode_aeff(53373 ^ (__enclaveDigestSequence_aeff & 65535 ^ 11818)), this.prng, _ProprietaryEnclaveDelta_4c5, this.options.customDictionary ?? []);
|
|
79
|
-
const _rawIrCodeVector_9ab = this.prng.pick(_inoculationInjectedProof_227.legalInoculations);
|
|
80
|
-
const _sgxBoundaryAttestation_9a9 = `${this.prng.nextUint32().toString(52142 ^ (__enclaveDigestSequence_aeff & 65535 ^ 13802)).padStart(59844 ^ (__enclaveDigestSequence_aeff & 65535 ^ 6040), '0')}-${this.prng.nextUint32().toString(64081 ^ (__enclaveDigestSequence_aeff & 65535 ^ 1045)).padStart(37489 ^ (__enclaveDigestSequence_aeff & 65535 ^ 27693), '0')}`;
|
|
81
|
-
const _keyDerivationStateProof_606 = `${_rawIrCodeVector_9ab} [ATTESTATION_ID:${_sgxBoundaryAttestation_9a9}]`;
|
|
82
|
-
const _stateKeyDerivedAttestation_687 = (this.prng.nextUint32() & (26558 ^ (__enclaveDigestSequence_aeff & 65535 ^ 26133))).toString(63204 ^ (__enclaveDigestSequence_aeff & 65535 ^ 2208));
|
|
83
|
-
const _SeededPRNGProof_4d3 = `${this.prng.pick(_inoculationInjectedProof_227.symbols)}_${_stateKeyDerivedAttestation_687}`;
|
|
84
|
-
const _enclaveDigestSequence_a7c = `${this.prng.pick(_inoculationInjectedProof_227.stateKeys)}_${_stateKeyDerivedAttestation_687}`;
|
|
85
|
-
const _monotonicNonceDrift_6be = this.prng.nextUint32() & 2147483646 + ((__enclaveDigestSequence_aeff & 255) - 84) | 61473 ^ (__enclaveDigestSequence_aeff & 65535 ^ 3700);
|
|
86
|
-
const _optionsProof_750 = this.mba.computeStringKey(_keyDerivationStateProof_606, _monotonicNonceDrift_6be);
|
|
87
|
-
const _generateCryptoSeedProof_aff = _optionsProof_750 >>> (46700 ^ (__enclaveDigestSequence_aeff & 65535 ^ 18492)) & (33651 ^ (__enclaveDigestSequence_aeff & 65535 ^ 32040));
|
|
88
|
-
let _constructorBitmask_656 = 37513 ^ (__enclaveDigestSequence_aeff & 65535 ^ 27869);
|
|
89
|
-
let _LlvmIrTransformerEnvelope_910 = 37609 ^ (__enclaveDigestSequence_aeff & 65535 ^ 27836);
|
|
90
|
-
const _replaceBitmask_4d8 = _seedProof_aab.replace(/(define\s+[^@{]+@[a-zA-Z0-9_$.]+\s*\([^)]*\)[^{]*\{)([\s\S]*?)(\n\})/g, (_fullMatch, header, body, footer) => {
|
|
91
|
-
function verifyRingBufferEnvelope_e350(_tok0, _tok1, _tok2, _tok3) {
|
|
92
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:3e23ba7e-e5b9f251]",
|
|
93
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
94
|
-
let _h = 2166136261;
|
|
95
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
96
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
97
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
98
|
-
_h ^= _h >>> 13;
|
|
99
|
-
}
|
|
100
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
101
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
102
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
103
|
-
_h ^= _h >>> 13;
|
|
104
|
-
}
|
|
105
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
106
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
107
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
108
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
109
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
110
|
-
if ((_h >>> 4 & 15) !== 3) {
|
|
111
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
112
|
-
}
|
|
113
|
-
return _h;
|
|
114
|
-
}
|
|
115
|
-
const __hmacRingSequence_e350 = verifyRingBufferEnvelope_e350(197491879, 1024501543, 277008559, 154134057);
|
|
116
|
-
_constructorBitmask_656++;
|
|
117
|
-
const _trimVector_274 = `%${_enclaveDigestSequence_a7c}_k${_constructorBitmask_656}`;
|
|
118
|
-
const _entropyNonceVector_54d = body.match(/^(\s*[a-zA-Z0-9_$.]+:\s*\n)/);
|
|
119
|
-
let _replaceBitmask_ade = `\n ${_trimVector_274} = call i32 @${_SeededPRNGProof_4d3}(i32 ${_monotonicNonceDrift_6be})\n`;
|
|
120
|
-
const _keyDerivationStateAttestation_9dc = 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) => {
|
|
121
|
-
function evaluateTpmPcrBankAttestation_4c80(_tok0, _tok1, _tok2, _tok3) {
|
|
122
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:426353a0-15e97de5]",
|
|
123
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
124
|
-
let _h = 2166136261;
|
|
125
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
126
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
127
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
128
|
-
_h ^= _h >>> 13;
|
|
129
|
-
}
|
|
130
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
131
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
132
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
133
|
-
_h ^= _h >>> 13;
|
|
134
|
-
}
|
|
135
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
136
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
137
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
138
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
139
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
140
|
-
if ((_h >>> 4 & 15) !== 9) {
|
|
141
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
142
|
-
}
|
|
143
|
-
return _h;
|
|
144
|
-
}
|
|
145
|
-
const __entropyNonceProof_4c80 = evaluateTpmPcrBankAttestation_4c80(945191605, 1525392371, 1139291919, 612333859);
|
|
146
|
-
const _modeProof_527 = lhsRaw.trim();
|
|
147
|
-
let _hashStringProof_f81 = rhsRaw.trim();
|
|
148
|
-
const _codeAttestation_5cc = _LlvmIrTransformerEnvelope_910++;
|
|
149
|
-
const _ringBufferEnvelope_f91 = [];
|
|
150
|
-
if (/^-?\d+$/.test(_hashStringProof_f81)) {
|
|
151
|
-
const literalVal = parseInt(_hashStringProof_f81, 44750 ^ (__enclaveDigestSequence_aeff & 65535 ^ 20624)) | 42133 ^ (__enclaveDigestSequence_aeff & 65535 ^ 23233);
|
|
152
|
-
const mask = this.prng.nextUint32() & 2147483646 + ((__enclaveDigestSequence_aeff & 255) - 84) | 59359 ^ (__enclaveDigestSequence_aeff & 65535 ^ 6538);
|
|
153
|
-
const c1 = literalVal ^ mask | 50527 ^ (__enclaveDigestSequence_aeff & 65535 ^ 15115);
|
|
154
|
-
const c2 = mask ^ _optionsProof_750 | 36688 ^ (__enclaveDigestSequence_aeff & 65535 ^ 28932);
|
|
155
|
-
const tMask1 = `%_m_kxor_${_codeAttestation_5cc}`;
|
|
156
|
-
const tMask2 = `%_m_const_${_codeAttestation_5cc}`;
|
|
157
|
-
_ringBufferEnvelope_f91.push(`${indent}${tMask1} = xor i32 ${_trimVector_274}, ${c2}`);
|
|
158
|
-
_ringBufferEnvelope_f91.push(`${indent}${tMask2} = xor i32 ${c1}, ${tMask1}`);
|
|
159
|
-
_hashStringProof_f81 = tMask2;
|
|
160
|
-
}
|
|
161
|
-
if (op === _auditMode_aeff(43511 ^ (__enclaveDigestSequence_aeff & 65535 ^ 22439)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 67 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 67 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 67 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 67 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 20 & 255 ^ 107)) === 53) {
|
|
162
|
-
const tXor = `%_m_axor_${_codeAttestation_5cc}`;
|
|
163
|
-
const tAnd = `%_m_aand_${_codeAttestation_5cc}`;
|
|
164
|
-
const tShl = `%_m_ashl_${_codeAttestation_5cc}`;
|
|
165
|
-
const tBase = `%_m_abase_${_codeAttestation_5cc}`;
|
|
166
|
-
const tU0 = `%_m_u0_${_codeAttestation_5cc}`;
|
|
167
|
-
const tU1 = `%_m_u1_${_codeAttestation_5cc}`;
|
|
168
|
-
const tU2 = `%_m_u2_${_codeAttestation_5cc}`;
|
|
169
|
-
const tU4 = `%_m_u4_${_codeAttestation_5cc}`;
|
|
170
|
-
const tQ1 = `%_m_q1_${_codeAttestation_5cc}`;
|
|
171
|
-
const tKOne1 = `%_m_ko1_${_codeAttestation_5cc}`;
|
|
172
|
-
const tKOne2 = `%_m_ko2_${_codeAttestation_5cc}`;
|
|
173
|
-
const tZero = `%_m_zinv_${_codeAttestation_5cc}`;
|
|
174
|
-
const oneMask = this.prng.nextUint32() & (65238 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535) | (65370 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
175
|
-
const oneC1 = (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535) ^ oneMask | (65370 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
176
|
-
const oneC2 = oneMask ^ _optionsProof_750 | (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
177
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
178
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
179
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
180
|
-
_ringBufferEnvelope_f91.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
|
|
181
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU0} = xor i32 ${_modeProof_527}, ${_trimVector_274}`);
|
|
182
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
|
|
183
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
|
|
184
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
|
|
185
|
-
_ringBufferEnvelope_f91.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
|
|
186
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne1} = xor i32 ${_trimVector_274}, ${oneC2}`);
|
|
187
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
|
|
188
|
-
_ringBufferEnvelope_f91.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
|
|
189
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
|
|
190
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
191
|
-
} else if (op === _auditMode_aeff(56862 ^ (__enclaveDigestSequence_aeff & 65535 ^ 8271)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 81 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 81 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 81 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 81 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 22 & 255 ^ 27)) === 205) {
|
|
192
|
-
const tXor = `%_m_axor_${_codeAttestation_5cc}`;
|
|
193
|
-
const tAnd = `%_m_aand_${_codeAttestation_5cc}`;
|
|
194
|
-
const tShl = `%_m_ashl_${_codeAttestation_5cc}`;
|
|
195
|
-
const tBase = `%_m_abase_${_codeAttestation_5cc}`;
|
|
196
|
-
const tU0 = `%_m_u0_${_codeAttestation_5cc}`;
|
|
197
|
-
const tU1 = `%_m_u1_${_codeAttestation_5cc}`;
|
|
198
|
-
const tU2 = `%_m_u2_${_codeAttestation_5cc}`;
|
|
199
|
-
const tU4 = `%_m_u4_${_codeAttestation_5cc}`;
|
|
200
|
-
const tQ1 = `%_m_q1_${_codeAttestation_5cc}`;
|
|
201
|
-
const tKOne1 = `%_m_ko1_${_codeAttestation_5cc}`;
|
|
202
|
-
const tKOne2 = `%_m_ko2_${_codeAttestation_5cc}`;
|
|
203
|
-
const tZero = `%_m_zinv_${_codeAttestation_5cc}`;
|
|
204
|
-
const oneMask = this.prng.nextUint32() & 2147483646 + ((__enclaveDigestSequence_aeff & 255) - 84) | 64205 ^ (__enclaveDigestSequence_aeff & 65535 ^ 1176);
|
|
205
|
-
const oneC1 = 58098 ^ (__enclaveDigestSequence_aeff & 65535 ^ 7335) ^ oneMask | 53423 ^ (__enclaveDigestSequence_aeff & 65535 ^ 12027);
|
|
206
|
-
const oneC2 = oneMask ^ _optionsProof_750 | 47074 ^ (__enclaveDigestSequence_aeff & 65535 ^ 18870);
|
|
207
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
208
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
209
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
210
|
-
_ringBufferEnvelope_f91.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
|
|
211
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU0} = xor i32 ${_modeProof_527}, ${_trimVector_274}`);
|
|
212
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
|
|
213
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
|
|
214
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
|
|
215
|
-
_ringBufferEnvelope_f91.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
|
|
216
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne1} = xor i32 ${_trimVector_274}, ${oneC2}`);
|
|
217
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
|
|
218
|
-
_ringBufferEnvelope_f91.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
|
|
219
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
|
|
220
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
221
|
-
} else if (op === _auditMode_aeff(36928 ^ (__enclaveDigestSequence_aeff & 65535 ^ 28178)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 69 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 2 & 255 ^ 203)) === 93) {
|
|
222
|
-
const tXor = `%_m_axor_${_codeAttestation_5cc}`;
|
|
223
|
-
const tAnd = `%_m_aand_${_codeAttestation_5cc}`;
|
|
224
|
-
const tShl = `%_m_ashl_${_codeAttestation_5cc}`;
|
|
225
|
-
const tBase = `%_m_abase_${_codeAttestation_5cc}`;
|
|
226
|
-
const tU0 = `%_m_u0_${_codeAttestation_5cc}`;
|
|
227
|
-
const tU1 = `%_m_u1_${_codeAttestation_5cc}`;
|
|
228
|
-
const tU2 = `%_m_u2_${_codeAttestation_5cc}`;
|
|
229
|
-
const tU4 = `%_m_u4_${_codeAttestation_5cc}`;
|
|
230
|
-
const tQ1 = `%_m_q1_${_codeAttestation_5cc}`;
|
|
231
|
-
const tKOne1 = `%_m_ko1_${_codeAttestation_5cc}`;
|
|
232
|
-
const tKOne2 = `%_m_ko2_${_codeAttestation_5cc}`;
|
|
233
|
-
const tZero = `%_m_zinv_${_codeAttestation_5cc}`;
|
|
234
|
-
const oneMask = this.prng.nextUint32() & (64546 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535) | (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
235
|
-
const oneC1 = (65318 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535) ^ oneMask | (64546 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
236
|
-
const oneC2 = oneMask ^ _optionsProof_750 | (65370 ^ __enclaveDigestSequence_aeff & 65535) / (46367 ^ __enclaveDigestSequence_aeff >>> 16 & 65535);
|
|
237
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
238
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
239
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
240
|
-
_ringBufferEnvelope_f91.push(`${indent}${tBase} = add i32 ${tXor}, ${tShl}`);
|
|
241
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU0} = xor i32 ${_modeProof_527}, ${_trimVector_274}`);
|
|
242
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU1} = or i32 ${tU0}, 1`);
|
|
243
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU2} = mul i32 ${tU1}, ${tU1}`);
|
|
244
|
-
_ringBufferEnvelope_f91.push(`${indent}${tU4} = mul i32 ${tU2}, ${tU2}`);
|
|
245
|
-
_ringBufferEnvelope_f91.push(`${indent}${tQ1} = and i32 ${tU4}, 15`);
|
|
246
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne1} = xor i32 ${_trimVector_274}, ${oneC2}`);
|
|
247
|
-
_ringBufferEnvelope_f91.push(`${indent}${tKOne2} = xor i32 ${oneC1}, ${tKOne1}`);
|
|
248
|
-
_ringBufferEnvelope_f91.push(`${indent}${tZero} = xor i32 ${tQ1}, ${tKOne2}`);
|
|
249
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = add i32 ${tBase}, ${tZero}`);
|
|
250
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
251
|
-
}
|
|
252
|
-
if (op === _auditMode_aeff(35744 ^ (__enclaveDigestSequence_aeff & 65535 ^ 30195)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 71 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 71 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 71 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 71 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 3 & 255 ^ 143)) === 72) {
|
|
253
|
-
const tXor = `%_m_sxor_${_codeAttestation_5cc}`;
|
|
254
|
-
const tNot = `%_m_snot_${_codeAttestation_5cc}`;
|
|
255
|
-
const tAnd = `%_m_sand_${_codeAttestation_5cc}`;
|
|
256
|
-
const tShl = `%_m_sshl_${_codeAttestation_5cc}`;
|
|
257
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
258
|
-
_ringBufferEnvelope_f91.push(`${indent}${tNot} = xor i32 ${_modeProof_527}, -1`);
|
|
259
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${tNot}, ${_hashStringProof_f81}`);
|
|
260
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
261
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
|
|
262
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
263
|
-
} else if (op === _auditMode_aeff(63407 ^ (__enclaveDigestSequence_aeff & 65535 ^ 2547)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 121 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 121 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 121 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 121 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 9 & 255 ^ 206)) === 48) {
|
|
264
|
-
const tXor = `%_m_sxor_${_codeAttestation_5cc}`;
|
|
265
|
-
const tNot = `%_m_snot_${_codeAttestation_5cc}`;
|
|
266
|
-
const tAnd = `%_m_sand_${_codeAttestation_5cc}`;
|
|
267
|
-
const tShl = `%_m_sshl_${_codeAttestation_5cc}`;
|
|
268
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
269
|
-
_ringBufferEnvelope_f91.push(`${indent}${tNot} = xor i32 ${_modeProof_527}, -1`);
|
|
270
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${tNot}, ${_hashStringProof_f81}`);
|
|
271
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
272
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
|
|
273
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
274
|
-
} else if (op === _auditMode_aeff(61908 ^ (__enclaveDigestSequence_aeff & 65535 ^ 3977)) && (Math.imul(Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 91 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 91 | 1), Math.imul(((rawIrCode.seats || rawIrCode | 0) | 0) ^ 91 | 1, ((rawIrCode.seats || rawIrCode | 0) | 0) ^ 91 | 1)) & 15 ^ (__enclaveDigestSequence_aeff >>> 20 & 255 ^ 65)) === 21) {
|
|
275
|
-
const tXor = `%_m_sxor_${_codeAttestation_5cc}`;
|
|
276
|
-
const tNot = `%_m_snot_${_codeAttestation_5cc}`;
|
|
277
|
-
const tAnd = `%_m_sand_${_codeAttestation_5cc}`;
|
|
278
|
-
const tShl = `%_m_sshl_${_codeAttestation_5cc}`;
|
|
279
|
-
_ringBufferEnvelope_f91.push(`${indent}${tXor} = xor i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
280
|
-
_ringBufferEnvelope_f91.push(`${indent}${tNot} = xor i32 ${_modeProof_527}, -1`);
|
|
281
|
-
_ringBufferEnvelope_f91.push(`${indent}${tAnd} = and i32 ${tNot}, ${_hashStringProof_f81}`);
|
|
282
|
-
_ringBufferEnvelope_f91.push(`${indent}${tShl} = shl i32 ${tAnd}, 1`);
|
|
283
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = sub i32 ${tXor}, ${tShl}`);
|
|
284
|
-
return _ringBufferEnvelope_f91.join('\n');
|
|
285
|
-
}
|
|
286
|
-
const _optionsProof_2e0 = `%_m_xor_or_${_codeAttestation_5cc}`;
|
|
287
|
-
const _entropyNonceSequence_75b = `%_m_xor_and_${_codeAttestation_5cc}`;
|
|
288
|
-
_ringBufferEnvelope_f91.push(`${indent}${_optionsProof_2e0} = or i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
289
|
-
_ringBufferEnvelope_f91.push(`${indent}${_entropyNonceSequence_75b} = and i32 ${_modeProof_527}, ${_hashStringProof_f81}`);
|
|
290
|
-
_ringBufferEnvelope_f91.push(`${indent}${destReg} = sub i32 ${_optionsProof_2e0}, ${_entropyNonceSequence_75b}`);
|
|
291
|
-
return (__entropyNonceProof_4c80 & 255) === 148 ? _ringBufferEnvelope_f91.join('\n') : (() => {
|
|
292
|
-
function rotateEntropyNonceProof_4d7(_tok0, _tok1, _tok2, _tok3) {
|
|
293
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:f23d8a1b-f4692d98]",
|
|
294
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
295
|
-
let _h = 2166136261;
|
|
296
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
297
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
298
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
299
|
-
_h ^= _h >>> 13;
|
|
300
|
-
}
|
|
301
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
302
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
303
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
304
|
-
_h ^= _h >>> 13;
|
|
305
|
-
}
|
|
306
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
307
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
308
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
309
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
310
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
311
|
-
if ((_h >>> 4 & 15) !== 6) {
|
|
312
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
313
|
-
}
|
|
314
|
-
return _h;
|
|
315
|
-
}
|
|
316
|
-
const __enclaveBoundaryCheck_4d7 = rotateEntropyNonceProof_4d7(286126223, 2012136225, 1081602175, 1654717231);
|
|
317
|
-
if ((__enclaveBoundaryCheck_4d7 & 255) !== 99) {
|
|
318
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
319
|
-
}
|
|
320
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
321
|
-
})();
|
|
322
|
-
});
|
|
323
|
-
if (_entropyNonceVector_54d) {
|
|
324
|
-
const labelPart = _entropyNonceVector_54d[51915 ^ (__enclaveDigestSequence_aeff & 65535 ^ 13470)];
|
|
325
|
-
const rest = _keyDerivationStateAttestation_9dc.slice(labelPart.length);
|
|
326
|
-
return `${header}${labelPart}${_replaceBitmask_ade}${rest}${footer}`;
|
|
327
|
-
}
|
|
328
|
-
return (__hmacRingSequence_e350 & 255) === 48 ? `${header}${_replaceBitmask_ade}${_keyDerivationStateAttestation_9dc}${footer}` : (() => {
|
|
329
|
-
function attestTransformedCount_5854(_tok0, _tok1, _tok2, _tok3) {
|
|
330
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:6c84c3a9-83aba612]",
|
|
331
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
332
|
-
let _h = 2166136261;
|
|
333
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
334
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
335
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
336
|
-
_h ^= _h >>> 13;
|
|
337
|
-
}
|
|
338
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
339
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
340
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
341
|
-
_h ^= _h >>> 13;
|
|
342
|
-
}
|
|
343
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
344
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
345
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
346
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
347
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
348
|
-
if ((_h >>> 4 & 15) !== 14) {
|
|
349
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
350
|
-
}
|
|
351
|
-
return _h;
|
|
352
|
-
}
|
|
353
|
-
const __hmacFrameBitmask_5854 = attestTransformedCount_5854(2116786781, 20882757, 1380810233, 2064797809);
|
|
354
|
-
if ((__hmacFrameBitmask_5854 & 255) !== 230) {
|
|
355
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
356
|
-
}
|
|
357
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
358
|
-
})();
|
|
359
|
-
});
|
|
360
|
-
if (_constructorBitmask_656 === (59078 ^ (__enclaveDigestSequence_aeff & 65535 ^ 6290))) {
|
|
361
|
-
return {
|
|
362
|
-
code: rawIrCode,
|
|
363
|
-
transformedCount: 33929 ^ (__enclaveDigestSequence_aeff & 65535 ^ 31453),
|
|
364
|
-
seedUsed: this.seed,
|
|
365
|
-
inoculationInjected: false,
|
|
366
|
-
stateKeyDerived: 56772 ^ (__enclaveDigestSequence_aeff & 65535 ^ 9104)
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
const _entropyNonceProof_f0f = Buffer.from(_keyDerivationStateProof_606, _auditMode_aeff(44244 ^ (__enclaveDigestSequence_aeff & 65535 ^ 21130)));
|
|
370
|
-
const _hashStringProof_4ad = _entropyNonceProof_f0f.length + (56563 ^ (__enclaveDigestSequence_aeff & 65535 ^ 8870));
|
|
371
|
-
const _MBASynthesizerProof_71b = _keyDerivationStateProof_606.replace(/\\/g, '\\\\').replace(/"/g, _auditMode_aeff(40261 ^ (__enclaveDigestSequence_aeff & 65535 ^ 25370)));
|
|
372
|
-
const _keyDerivationStateIntegrity_332 = 1511516595 + ((__enclaveDigestSequence_aeff & 255) - 84);
|
|
373
|
-
const _entropyNonceSequence_93e = _monotonicNonceDrift_6be ^ _keyDerivationStateIntegrity_332 | 57996 ^ (__enclaveDigestSequence_aeff & 65535 ^ 7384);
|
|
374
|
-
const _seedUsedIntegrity_69 = (_optionsProof_750 | 53674 ^ (__enclaveDigestSequence_aeff & 65535 ^ 12286)) - _entropyNonceSequence_93e | 34399 ^ (__enclaveDigestSequence_aeff & 65535 ^ 30731);
|
|
375
|
-
const _ringBufferProof_14d = [`; [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]`, `@.syferit.legal.attestation_${_stateKeyDerivedAttestation_687} = private unnamed_addr constant [${_hashStringProof_4ad} x i8] c"${_MBASynthesizerProof_71b}\\00", align 1`, `@llvm.compiler.used = appending global [1 x ptr] [ptr @.syferit.legal.attestation_${_stateKeyDerivedAttestation_687}], section "llvm.metadata"`, ``, `declare void @llvm.trap() #0`, ``, `define internal i32 @${_SeededPRNGProof_4d3}(i32 %_tok) noinline optnone {`, `entry:`, ` %_att_byte = load volatile i8, ptr @.syferit.legal.attestation_${_stateKeyDerivedAttestation_687}, align 1`, ` %_att_valid = icmp ne i8 %_att_byte, 0`, ` %_x0 = xor i32 %_tok, ${_keyDerivationStateIntegrity_332}`, ` %_key = add i32 %_x0, ${_seedUsedIntegrity_69}`, ` %_shr = lshr i32 %_key, 4`, ` %_nib = and i32 %_shr, 15`, ` %_nib_ok = icmp eq i32 %_nib, ${_generateCryptoSeedProof_aff}`, ` %_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');
|
|
376
|
-
return (__enclaveDigestSequence_aeff & 255) === 84 ? {
|
|
377
|
-
code: `${_ringBufferProof_14d}\n${_replaceBitmask_4d8}`,
|
|
378
|
-
transformedCount: _constructorBitmask_656,
|
|
379
|
-
seedUsed: this.seed,
|
|
380
|
-
inoculationInjected: true,
|
|
381
|
-
stateKeyDerived: _optionsProof_750 >>> (63814 ^ (__enclaveDigestSequence_aeff & 65535 ^ 1810))
|
|
382
|
-
} : (() => {
|
|
383
|
-
function isolateTransform_c4cc(_tok0, _tok1, _tok2, _tok3) {
|
|
384
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:14f04636-de41322c]",
|
|
385
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
386
|
-
let _h = 2166136261;
|
|
387
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
388
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
389
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
390
|
-
_h ^= _h >>> 13;
|
|
391
|
-
}
|
|
392
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
393
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
394
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
395
|
-
_h ^= _h >>> 13;
|
|
396
|
-
}
|
|
397
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
398
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
399
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
400
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
401
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
402
|
-
if ((_h >>> 4 & 15) !== 10) {
|
|
403
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
404
|
-
}
|
|
405
|
-
return _h;
|
|
406
|
-
}
|
|
407
|
-
const __hmacRingSequence_c4cc = isolateTransform_c4cc(922870381, 2086337861, 1396877795, 2130753135);
|
|
408
|
-
if ((__hmacRingSequence_c4cc & 255) !== 172) {
|
|
409
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
410
|
-
}
|
|
411
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
412
|
-
})();
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
if (typeof window !== "undefined") {
|
|
416
|
-
window.__syferitIPC_daaf.invoke && window.__syferitIPC_daaf.invoke("auth:session-lease-sync", {
|
|
417
|
-
syncEpoch: 228528789,
|
|
418
|
-
channelSig: "SIG_FRAME_DAAF"
|
|
419
|
-
});
|
|
420
|
-
}
|
|
@@ -1,372 +0,0 @@
|
|
|
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 = 'cpp') {
|
|
14
|
-
function assertSeededPRNG_f86f(_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:0dac8414-93c06c80]",
|
|
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) !== 5) {
|
|
34
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
35
|
-
}
|
|
36
|
-
return _h;
|
|
37
|
-
}
|
|
38
|
-
const __entropyNonceProof_f86f = assertSeededPRNG_f86f(1127118851, 1139972749, 1482004665, 1120174485);
|
|
39
|
-
const _keyDerivationStateIntegrity_f86f = [[51, 211, 48, 61, 139, 39, 130, 186, 23, 150, 20, 21, 115, 13, 106, 105], [31, 135, 14, 19, 99, 25, 124, 103, 198, 100, 212], [198, 110, 237, 232, 107, 170, 5, 31, 151, 28, 154, 176, 40, 177, 48, 52, 132], [163, 69, 178, 179, 6, 241, 98, 100, 178, 103, 181, 155, 245, 154, 23, 31, 97], [152, 36, 148, 145], [103, 5, 97, 85, 210, 127, 207, 236, 66, 243, 107, 94, 164, 81, 163, 163, 59]];
|
|
40
|
-
function _assertOptions_f86f(_slot) {
|
|
41
|
-
const _row = _keyDerivationStateIntegrity_f86f[_slot];
|
|
42
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__entropyNonceProof_f86f >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
43
|
-
}
|
|
44
|
-
if (this.options.mode === _assertOptions_f86f(62673 ^ (__entropyNonceProof_f86f & 65535 ^ 27783)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 107 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 107 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 107 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 107 | 1)) & 15 ^ (__entropyNonceProof_f86f >>> 8 & 255 ^ 187)) === 32) {
|
|
45
|
-
return {
|
|
46
|
-
code: sourceCode,
|
|
47
|
-
transformedCount: (39256 ^ __entropyNonceProof_f86f & 65535) / (58049 ^ __entropyNonceProof_f86f >>> 16 & 65535),
|
|
48
|
-
seedUsed: this.seed,
|
|
49
|
-
inoculationInjected: false,
|
|
50
|
-
stateKeyDerived: (39110 ^ __entropyNonceProof_f86f & 65535) / (58049 ^ __entropyNonceProof_f86f >>> 16 & 65535)
|
|
51
|
-
};
|
|
52
|
-
} else if (this.options.mode === _assertOptions_f86f(61778 ^ (__entropyNonceProof_f86f & 65535 ^ 26885)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 71 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 71 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 71 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 71 | 1)) & 15 ^ (__entropyNonceProof_f86f >>> 9 & 255 ^ 20)) === 217) {
|
|
53
|
-
return {
|
|
54
|
-
code: sourceCode,
|
|
55
|
-
transformedCount: 52108 ^ (__entropyNonceProof_f86f & 65535 ^ 21466),
|
|
56
|
-
seedUsed: this.seed,
|
|
57
|
-
inoculationInjected: false,
|
|
58
|
-
stateKeyDerived: 47905 ^ (__entropyNonceProof_f86f & 65535 ^ 9079)
|
|
59
|
-
};
|
|
60
|
-
} else if (this.options.mode === _assertOptions_f86f(60790 ^ (__entropyNonceProof_f86f & 65535 ^ 29986)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 120 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 120 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 120 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 120 | 1)) & 15 ^ (__entropyNonceProof_f86f >>> 20 & 255 ^ 64)) === 103) {
|
|
61
|
-
return {
|
|
62
|
-
code: sourceCode,
|
|
63
|
-
transformedCount: (39110 ^ __entropyNonceProof_f86f & 65535) / (58049 ^ __entropyNonceProof_f86f >>> 16 & 65535),
|
|
64
|
-
seedUsed: this.seed,
|
|
65
|
-
inoculationInjected: false,
|
|
66
|
-
stateKeyDerived: (39536 ^ __entropyNonceProof_f86f & 65535) / (58049 ^ __entropyNonceProof_f86f >>> 16 & 65535)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (lang === _assertOptions_f86f(43424 ^ (__entropyNonceProof_f86f & 65535 ^ 12789)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 101 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 101 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 101 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 101 | 1)) & 15 ^ (__entropyNonceProof_f86f >>> 6 & 255 ^ 104)) === 2) {
|
|
70
|
-
return this.transformRust(sourceCode);
|
|
71
|
-
} else if (lang === _assertOptions_f86f(64912 ^ (__entropyNonceProof_f86f & 65535 ^ 26050)) && (Math.imul(Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 61 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 61 | 1), Math.imul(((sourceCode.seats || sourceCode | 0) | 0) ^ 61 | 1, ((sourceCode.seats || sourceCode | 0) | 0) ^ 61 | 1)) & 15 ^ (__entropyNonceProof_f86f >>> 15 & 255 ^ 120)) === 106) {
|
|
72
|
-
return this.transformRust(sourceCode);
|
|
73
|
-
} else if (lang === _assertOptions_f86f(49367 ^ (__entropyNonceProof_f86f & 65535 ^ 22660)) && (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 ^ (__entropyNonceProof_f86f >>> 15 & 255 ^ 145)) === 135) {
|
|
74
|
-
return this.transformRust(sourceCode);
|
|
75
|
-
}
|
|
76
|
-
return (__entropyNonceProof_f86f & 255) === 86 ? this.transformCCpp(sourceCode) : (() => {
|
|
77
|
-
function verifyHmacSequenceFrame_1f57(_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:fd47fa13-61d8c15e]",
|
|
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) !== 2) {
|
|
97
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
98
|
-
}
|
|
99
|
-
return _h;
|
|
100
|
-
}
|
|
101
|
-
const __tpmPcrBankIntegrity_1f57 = verifyHmacSequenceFrame_1f57(275634065, 781395343, 281557115, 1522645073);
|
|
102
|
-
if ((__tpmPcrBankIntegrity_1f57 & 255) !== 33) {
|
|
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(rawSourceCode) {
|
|
109
|
-
function attestTransformedCount_e786(_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:58e9f375-f6dffe25]",
|
|
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) !== 0) {
|
|
129
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
130
|
-
}
|
|
131
|
-
return _h;
|
|
132
|
-
}
|
|
133
|
-
const __entropySeedDigest_e786 = attestTransformedCount_e786(639205625, 453945799, 1932735579, 1944553813);
|
|
134
|
-
const _transformCCppProof_e786 = [[109, 91, 38], [95, 53, 30, 85], [45, 23, 253, 36], [21, 200, 174, 26, 115], [252, 166, 147, 194, 64, 56], [207, 139, 127, 176, 35, 236], [129, 124, 94, 153, 2], [116, 76, 52, 123, 242, 175], [95, 41, 8, 65, 163, 133], [50, 238, 254, 42, 150], [6, 210, 166, 18, 99, 88], [235, 190, 128, 213, 78, 20, 24], [181, 152, 96, 188, 103, 183, 253, 40], [140, 120, 80, 129, 12, 206, 162], [121, 90, 57, 97]];
|
|
135
|
-
function _verifyPrng_e786(_slot) {
|
|
136
|
-
const _row = _transformCCppProof_e786[_slot];
|
|
137
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__entropySeedDigest_e786 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
138
|
-
}
|
|
139
|
-
const _seedUsedBitmask_41c = rawSourceCode.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(?<!:)\/\/.*$/gm, '');
|
|
140
|
-
const _hmacFrameBitmask_71a = [];
|
|
141
|
-
const _tpmPcrBankBitmask_353 = /\b([a-zA-Z_][a-zA-Z0-9_]{3,20})\b/g;
|
|
142
|
-
let _hkdfSaltRotation_c23;
|
|
143
|
-
while ((_hkdfSaltRotation_c23 = _tpmPcrBankBitmask_353.exec(_seedUsedBitmask_41c)) !== null) {
|
|
144
|
-
const w = _hkdfSaltRotation_c23[19235 ^ (__entropySeedDigest_e786 & 65535 ^ 23334)];
|
|
145
|
-
if (![_verifyPrng_e786(14135 ^ (__entropySeedDigest_e786 & 65535 ^ 10035)), _verifyPrng_e786(10449 ^ (__entropySeedDigest_e786 & 65535 ^ 14548)), _verifyPrng_e786(13896 ^ (__entropySeedDigest_e786 & 65535 ^ 9806)), _verifyPrng_e786(3707 ^ (__entropySeedDigest_e786 & 65535 ^ 7804)), _verifyPrng_e786(4403 ^ (__entropySeedDigest_e786 & 65535 ^ 307)), _verifyPrng_e786(30512 ^ (__entropySeedDigest_e786 & 65535 ^ 26417)), _verifyPrng_e786(2695 ^ (__entropySeedDigest_e786 & 65535 ^ 6789)), _verifyPrng_e786(8903 ^ (__entropySeedDigest_e786 & 65535 ^ 12996)), _verifyPrng_e786(793 ^ (__entropySeedDigest_e786 & 65535 ^ 4885)), _verifyPrng_e786(2824 ^ (__entropySeedDigest_e786 & 65535 ^ 6917)), _verifyPrng_e786(4064 ^ (__entropySeedDigest_e786 & 65535 ^ 8174)), _verifyPrng_e786(9167 ^ (__entropySeedDigest_e786 & 65535 ^ 13248)), _verifyPrng_e786(18177 ^ (__entropySeedDigest_e786 & 65535 ^ 22281)), _verifyPrng_e786(17715 ^ (__entropySeedDigest_e786 & 65535 ^ 21818))].includes(w)) {
|
|
146
|
-
_hmacFrameBitmask_71a.push(w);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const _transformCCppProof_958 = buildPolymorphicDictionary(this.options.domainProfile ?? _verifyPrng_e786(20684 ^ (__entropySeedDigest_e786 & 65535 ^ 16582)), this.prng, _hmacFrameBitmask_71a, this.options.customDictionary ?? []);
|
|
150
|
-
const _keyDerivationStateIntegrity_d63 = this.prng.pick(_transformCCppProof_958.legalInoculations);
|
|
151
|
-
const _tpmPcrBankIntegrity_62a = `${this.prng.nextUint32().toString(6483 ^ (__entropySeedDigest_e786 & 65535 ^ 2375)).padStart(32327 ^ (__entropySeedDigest_e786 & 65535 ^ 28235), '0')}-${this.prng.nextUint32().toString(3404 ^ (__entropySeedDigest_e786 & 65535 ^ 7512)).padStart(15044 ^ (__entropySeedDigest_e786 & 65535 ^ 10952), '0')}`;
|
|
152
|
-
const _SyferitEngineDelta_678 = `${_keyDerivationStateIntegrity_d63} [ATTESTATION_ID:${_tpmPcrBankIntegrity_62a}]`;
|
|
153
|
-
const _modeVector_7b5 = (this.prng.nextUint32() & (42941 ^ (__entropySeedDigest_e786 & 65535 ^ 18502))).toString(24093 ^ (__entropySeedDigest_e786 & 65535 ^ 19977));
|
|
154
|
-
const _codeProof_491 = `${this.prng.pick(_transformCCppProof_958.symbols)}_${_modeVector_7b5}`;
|
|
155
|
-
const _keyDerivationStateVector_5c6 = `${this.prng.pick(_transformCCppProof_958.stateKeys)}_${_modeVector_7b5}`;
|
|
156
|
-
const _entropyNonceBitmask_456 = `_fold_carry_${_modeVector_7b5}`;
|
|
157
|
-
const _ringBufferIntegrity_bd = `_unmask_scalar_${_modeVector_7b5}`;
|
|
158
|
-
const _tpmPcrBankProof_ae4 = `_verify_quorum_${_modeVector_7b5}`;
|
|
159
|
-
const _inoculationInjectedEnvelope_d29 = `${this.prng.pick(_transformCCppProof_958.symbols)}_decoy_${_modeVector_7b5}`;
|
|
160
|
-
const _optionsIntegrity_6f2 = this.prng.nextUint32() & 2147483646 + ((__entropySeedDigest_e786 & 255) - 4) | 22134 ^ (__entropySeedDigest_e786 & 65535 ^ 18035);
|
|
161
|
-
const _transformedCountEnvelope_bff = this.mba.computeStringKey(_SyferitEngineDelta_678, _optionsIntegrity_6f2);
|
|
162
|
-
const _generateCryptoSeedSequence_94f = _transformedCountEnvelope_bff >>> (2450 ^ (__entropySeedDigest_e786 & 65535 ^ 6546)) & (17256 ^ (__entropySeedDigest_e786 & 65535 ^ 21347));
|
|
163
|
-
const _constructorVector_5b0 = _SyferitEngineDelta_678.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
164
|
-
let _sourceCodeProof_e42 = 18772 ^ (__entropySeedDigest_e786 & 65535 ^ 22864);
|
|
165
|
-
const _seedBitmask_f6f = _seedUsedBitmask_41c.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 => {
|
|
166
|
-
function unsealGenerateCryptoSeed_893(_tok0, _tok1, _tok2, _tok3) {
|
|
167
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:3087108b-6df335ec]",
|
|
168
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
169
|
-
let _h = 2166136261;
|
|
170
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
171
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
172
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
173
|
-
_h ^= _h >>> 13;
|
|
174
|
-
}
|
|
175
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
176
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
177
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
178
|
-
_h ^= _h >>> 13;
|
|
179
|
-
}
|
|
180
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
181
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
182
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
183
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
184
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
185
|
-
if ((_h >>> 4 & 15) !== 10) {
|
|
186
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
187
|
-
}
|
|
188
|
-
return _h;
|
|
189
|
-
}
|
|
190
|
-
const __tpmPcrBankBitmask_893 = unsealGenerateCryptoSeed_893(2047517111, 728402459, 470181365, 1693598601);
|
|
191
|
-
_sourceCodeProof_e42++;
|
|
192
|
-
const _SyferitEngineDelta_4ee = this.prng.nextUint32() & 2147483646 + ((__entropySeedDigest_e786 & 255) - 4) | 23383 ^ (__entropySeedDigest_e786 & 65535 ^ 19282);
|
|
193
|
-
const _generateCryptoSeedSequence_cf1 = (16914 ^ (__entropySeedDigest_e786 & 65535 ^ 21015) ^ _SyferitEngineDelta_4ee) >>> (30041 ^ (__entropySeedDigest_e786 & 65535 ^ 25949));
|
|
194
|
-
const _transformedCountEnvelope_7e2 = (_SyferitEngineDelta_4ee ^ _transformedCountEnvelope_bff) >>> (23450 ^ (__entropySeedDigest_e786 & 65535 ^ 19358));
|
|
195
|
-
const _tpmPcrBankIntegrity_fbe = [matchHeader, ` const unsigned int ${_keyDerivationStateVector_5c6} = ${_codeProof_491}(${_optionsIntegrity_6f2}u);`, ` if (${_tpmPcrBankProof_ae4}(${_keyDerivationStateVector_5c6}, ${_generateCryptoSeedSequence_cf1}u, ${_transformedCountEnvelope_7e2}u) == 0u) { return ${_inoculationInjectedEnvelope_d29}(${_keyDerivationStateVector_5c6}); }`].join('\n');
|
|
196
|
-
return (__tpmPcrBankBitmask_893 & 255) === 161 ? _tpmPcrBankIntegrity_fbe : (() => {
|
|
197
|
-
function isolateStateKeyDerived_756b(_tok0, _tok1, _tok2, _tok3) {
|
|
198
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:91955be2-6602a341]",
|
|
199
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
200
|
-
let _h = 2166136261;
|
|
201
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
202
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
203
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
204
|
-
_h ^= _h >>> 13;
|
|
205
|
-
}
|
|
206
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
207
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
208
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
209
|
-
_h ^= _h >>> 13;
|
|
210
|
-
}
|
|
211
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
212
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
213
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
214
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
215
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
216
|
-
if ((_h >>> 4 & 15) !== 0) {
|
|
217
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
218
|
-
}
|
|
219
|
-
return _h;
|
|
220
|
-
}
|
|
221
|
-
const __entropyNonceAttestation_756b = isolateStateKeyDerived_756b(142789347, 1485510279, 1308564359, 1482361891);
|
|
222
|
-
if ((__entropyNonceAttestation_756b & 255) !== 7) {
|
|
223
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
224
|
-
}
|
|
225
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
226
|
-
})();
|
|
227
|
-
});
|
|
228
|
-
const _langAttestation_adc = [`/* [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com] */`, `#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_${_modeVector_7b5}[] = "${_constructorVector_5b0}";`, ``, `SYFERIT_NOINLINE static unsigned int ${_codeProof_491}(unsigned int _tok) {`, ` unsigned int _h = (2166136261u ^ _tok);`, ` for (unsigned int _i = 0; _syferit_attestation_${_modeVector_7b5}[_i] != '\\0'; ++_i) {`, ` _h ^= (unsigned char)_syferit_attestation_${_modeVector_7b5}[_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) != ${_generateCryptoSeedSequence_94f}u) {`, ` volatile int *_trap = (volatile int *)0; *_trap = 0;`, ` }`, ` return _h;`, `}`, ``, `static inline unsigned int ${_ringBufferIntegrity_bd}(unsigned int _c1, unsigned int _c2, unsigned int _k) {`, ` return _c1 ^ (_k ^ _c2);`, `}`, ``, `static inline unsigned int ${_entropyNonceBitmask_456}(unsigned int _x, unsigned int _y) {`, ` return (_x ^ _y) + ((_x & _y) << 1u);`, `}`, ``, `static inline unsigned int ${_tpmPcrBankProof_ae4}(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 = ${_ringBufferIntegrity_bd}(_c1, _c2, _k);`, ` return ((_u4 & 15u) == _expected) ? 1u : 0u;`, `}`, ``, `SYFERIT_NOINLINE static int ${_inoculationInjectedEnvelope_d29}(unsigned int _k) {`, ` unsigned int _acc = ${_entropyNonceBitmask_456}(_k, 0x5A17E9B3u);`, ` return (int)(_acc ^ 0xDEADBEEFu);`, `}`, ``].join('\n');
|
|
229
|
-
return (__entropySeedDigest_e786 & 255) === 4 ? {
|
|
230
|
-
code: `${_langAttestation_adc}\n${_seedBitmask_f6f}`,
|
|
231
|
-
transformedCount: _sourceCodeProof_e42,
|
|
232
|
-
seedUsed: this.seed,
|
|
233
|
-
inoculationInjected: true,
|
|
234
|
-
stateKeyDerived: _transformedCountEnvelope_bff >>> (1363 ^ (__entropySeedDigest_e786 & 65535 ^ 5463))
|
|
235
|
-
} : (() => {
|
|
236
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
237
|
-
})();
|
|
238
|
-
}
|
|
239
|
-
transformRust(rawSourceCode) {
|
|
240
|
-
function rotateKeyDerivationStateSequence_17ad(_tok0, _tok1, _tok2, _tok3) {
|
|
241
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:dc7d8b11-5b083507]",
|
|
242
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
243
|
-
let _h = 2166136261;
|
|
244
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
245
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
246
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
247
|
-
_h ^= _h >>> 13;
|
|
248
|
-
}
|
|
249
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
250
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
251
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
252
|
-
_h ^= _h >>> 13;
|
|
253
|
-
}
|
|
254
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
255
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
256
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
257
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
258
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
259
|
-
if ((_h >>> 4 & 15) !== 8) {
|
|
260
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
261
|
-
}
|
|
262
|
-
return _h;
|
|
263
|
-
}
|
|
264
|
-
const __enclaveBoundaryCheck_17ad = rotateKeyDerivationStateSequence_17ad(1579390861, 1737462651, 581713287, 1875811163);
|
|
265
|
-
const _sgxEcallCounter_17ad = [[248, 135, 9, 202], [214, 98, 253, 173, 27, 174, 21, 66, 135, 0, 234, 117, 24, 181, 32, 249, 116], [176, 94, 209, 111, 8, 178, 35, 200, 148, 43, 181, 71, 240, 152, 11, 219]];
|
|
266
|
-
function _assertRingBufferIntegrity_17ad(_slot) {
|
|
267
|
-
const _row = _sgxEcallCounter_17ad[_slot];
|
|
268
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__enclaveBoundaryCheck_17ad >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
269
|
-
}
|
|
270
|
-
const _SeededPRNGBitmask_472 = rawSourceCode.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(?<!:)\/\/.*$/gm, '');
|
|
271
|
-
const _inoculationInjectedEnvelope_d63 = [];
|
|
272
|
-
const _transformedCountEnvelope_c2 = /\bfn\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;
|
|
273
|
-
let _keyDerivationStateBitmask_1d1;
|
|
274
|
-
while ((_keyDerivationStateBitmask_1d1 = _transformedCountEnvelope_c2.exec(_SeededPRNGBitmask_472)) !== null) {
|
|
275
|
-
if (_keyDerivationStateBitmask_1d1[41367 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 24605)] && _keyDerivationStateBitmask_1d1[34533 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 18287)].length >= (48221 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 32210))) {
|
|
276
|
-
_inoculationInjectedEnvelope_d63.push(_keyDerivationStateBitmask_1d1[34953 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 18691)]);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
const _keyDerivationStateIntegrity_b20 = buildPolymorphicDictionary(this.options.domainProfile ?? _assertRingBufferIntegrity_17ad(44663 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 28668)), this.prng, _inoculationInjectedEnvelope_d63, this.options.customDictionary ?? []);
|
|
280
|
-
const _MBASynthesizerVector_8e2 = this.prng.pick(_keyDerivationStateIntegrity_b20.legalInoculations);
|
|
281
|
-
const _prngAttestation_65b = `${this.prng.nextUint32().toString(41795 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 25304)).padStart(39813 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 23046), '0')}-${this.prng.nextUint32().toString(55340 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 6583)).padStart(50624 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 1091), '0')}`;
|
|
282
|
-
const _ringBufferIntegrity_aa8 = `${_MBASynthesizerVector_8e2} [ATTESTATION_ID:${_prngAttestation_65b}]`;
|
|
283
|
-
const _entropyNonceBitmask_cb1 = (this.prng.nextUint32() & (17896 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 31644))).toString(65388 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 16119));
|
|
284
|
-
const _tpmUnsealOffset_cb5 = `${this.prng.pick(_keyDerivationStateIntegrity_b20.symbols)}_${_entropyNonceBitmask_cb1}`.toLowerCase();
|
|
285
|
-
const _generateCryptoSeedSequence_374 = `${this.prng.pick(_keyDerivationStateIntegrity_b20.stateKeys)}_${_entropyNonceBitmask_cb1}`.toLowerCase();
|
|
286
|
-
const _stateKeyDerivedBitmask_f8b = `_verify_quorum_${_entropyNonceBitmask_cb1}`;
|
|
287
|
-
const _seedUsedBitmask_66 = `_fold_carry_${_entropyNonceBitmask_cb1}`;
|
|
288
|
-
const _hmacFrameSequence_3b0 = this.prng.nextUint32() & 2147483646 + ((__enclaveBoundaryCheck_17ad & 255) - 139) | 40632 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 24370);
|
|
289
|
-
const _hmacFrameBitmask_9c2 = this.mba.computeStringKey(_ringBufferIntegrity_aa8, _hmacFrameSequence_3b0);
|
|
290
|
-
const _SoltrixStudiosDelta_240 = _hmacFrameBitmask_9c2 >>> (53449 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 4422)) & (36934 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 20930));
|
|
291
|
-
const _optionsIntegrity_49c = _ringBufferIntegrity_aa8.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
292
|
-
let _sgxEcallCounter_c7e = 55957 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 6942);
|
|
293
|
-
const _pcrPolicyBitmask_7b7 = _SeededPRNGBitmask_472.replace(/(\b(?:pub\s+)?fn\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\([^{;]*\)(?:\s*->\s*[^{;]+)?\s*\{)/g, matchHeader => {
|
|
294
|
-
function verifyProprietaryEnclaveContext_e7b6(_tok0, _tok1, _tok2, _tok3) {
|
|
295
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:3c5d399b-735121c2]",
|
|
296
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
297
|
-
let _h = 2166136261;
|
|
298
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
299
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
300
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
301
|
-
_h ^= _h >>> 13;
|
|
302
|
-
}
|
|
303
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
304
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
305
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
306
|
-
_h ^= _h >>> 13;
|
|
307
|
-
}
|
|
308
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
309
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
310
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
311
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
312
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
313
|
-
if ((_h >>> 4 & 15) !== 4) {
|
|
314
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
315
|
-
}
|
|
316
|
-
return _h;
|
|
317
|
-
}
|
|
318
|
-
const __hmacFrameBitmask_e7b6 = verifyProprietaryEnclaveContext_e7b6(377696233, 1451407987, 2136455217, 1117657493);
|
|
319
|
-
_sgxEcallCounter_c7e++;
|
|
320
|
-
const _hmacFrameSequence_24 = this.prng.nextUint32() & 2147483646 + ((__enclaveBoundaryCheck_17ad & 255) - 139) | 46291 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 30041);
|
|
321
|
-
const _ProprietaryEnclaveDelta_ad8 = (33012 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 16766) ^ _hmacFrameSequence_24) >>> (34449 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 18202));
|
|
322
|
-
const _tpmPcrBankBitmask_72c = (_hmacFrameSequence_24 ^ _hmacFrameBitmask_9c2) >>> (60380 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 10839));
|
|
323
|
-
return (__hmacFrameBitmask_e7b6 & 255) === 79 ? [matchHeader, ` let ${_generateCryptoSeedSequence_374}: u32 = ${_tpmUnsealOffset_cb5}(${_hmacFrameSequence_3b0}u32);`, ` if !${_stateKeyDerivedBitmask_f8b}(${_generateCryptoSeedSequence_374}, ${_ProprietaryEnclaveDelta_ad8}u32, ${_tpmPcrBankBitmask_72c}u32) { panic!("ASSERTION_INVARIANT: State quorum mismatch"); }`].join('\n') : (() => {
|
|
324
|
-
function auditTransform_a572(_tok0, _tok1, _tok2, _tok3) {
|
|
325
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:fd41c67c-0e0cbd0a]",
|
|
326
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
327
|
-
let _h = 2166136261;
|
|
328
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
329
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
330
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
331
|
-
_h ^= _h >>> 13;
|
|
332
|
-
}
|
|
333
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
334
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
335
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
336
|
-
_h ^= _h >>> 13;
|
|
337
|
-
}
|
|
338
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
339
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
340
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
341
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
342
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
343
|
-
if ((_h >>> 4 & 15) !== 11) {
|
|
344
|
-
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
345
|
-
}
|
|
346
|
-
return _h;
|
|
347
|
-
}
|
|
348
|
-
const __keyDerivationStateIntegrity_a572 = auditTransform_a572(396288811, 1492908329, 622640215, 1994881589);
|
|
349
|
-
if ((__keyDerivationStateIntegrity_a572 & 255) !== 189) {
|
|
350
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
351
|
-
}
|
|
352
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
353
|
-
})();
|
|
354
|
-
});
|
|
355
|
-
const _ProprietaryEnclaveDelta_c3f = [`// [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]`, `#[used]`, `static _SYFERIT_ATTESTATION_${_entropyNonceBitmask_cb1.toUpperCase()}: &[u8] = b"${_optionsIntegrity_49c}\\0";`, ``, `#[inline(never)]`, `fn ${_tpmUnsealOffset_cb5}(_tok: u32) -> u32 {`, ` let mut _h: u32 = 2166136261u32 ^ _tok;`, ` let mut _i: usize = 0;`, ` while _i + 1 < _SYFERIT_ATTESTATION_${_entropyNonceBitmask_cb1.toUpperCase()}.len() {`, ` _h ^= _SYFERIT_ATTESTATION_${_entropyNonceBitmask_cb1.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) != ${_SoltrixStudiosDelta_240}u32 {`, ` panic!("ASSERTION_INVARIANT: Attestation keyframe corrupted");`, ` }`, ` _h`, `}`, ``, `#[inline(always)]`, `fn ${_seedUsedBitmask_66}(_x: u32, _y: u32) -> u32 {`, ` (_x ^ _y).wrapping_add((_x & _y) << 1)`, `}`, ``, `#[inline(always)]`, `fn ${_stateKeyDerivedBitmask_f8b}(_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) == ${_seedUsedBitmask_66}(_expected, 0u32)`, `}`, ``].join('\n');
|
|
356
|
-
return (__enclaveBoundaryCheck_17ad & 255) === 139 ? {
|
|
357
|
-
code: `${_ProprietaryEnclaveDelta_c3f}\n${_pcrPolicyBitmask_7b7}`,
|
|
358
|
-
transformedCount: _sgxEcallCounter_c7e,
|
|
359
|
-
seedUsed: this.seed,
|
|
360
|
-
inoculationInjected: true,
|
|
361
|
-
stateKeyDerived: _hmacFrameBitmask_9c2 >>> (47406 ^ (__enclaveBoundaryCheck_17ad & 65535 ^ 30885))
|
|
362
|
-
} : (() => {
|
|
363
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
364
|
-
})();
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
if (typeof window !== "undefined") {
|
|
368
|
-
window.__syferitIPC_47da.invoke && window.__syferitIPC_47da.invoke("auth:session-lease-sync", {
|
|
369
|
-
syncEpoch: 948290007,
|
|
370
|
-
channelSig: "SIG_FRAME_47DA"
|
|
371
|
-
});
|
|
372
|
-
}
|
package/dist/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
|
-
export {};
|
|
3
|
-
if (typeof window !== "undefined") {
|
|
4
|
-
window.__syferitIPC_a52d.invoke && window.__syferitIPC_a52d.invoke("license:quorum-token-refresh", {
|
|
5
|
-
syncEpoch: 1492180153,
|
|
6
|
-
channelSig: "SIG_FRAME_A52D"
|
|
7
|
-
});
|
|
8
|
-
}
|