@syferit/llvm 0.4.2 → 0.4.4

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/dist/index.d.ts CHANGED
@@ -1,13 +1,23 @@
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
- */
1
+ // [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
2
+ import type { SyferitOptions } from '@syferit/core';
3
+ export type NativeTargetLanguage = 'llvm-ir' | 'c' | 'cpp' | 'rust';
4
+ export interface NativeProtectionOptions extends SyferitOptions {
5
+ targetLanguage?: NativeTargetLanguage;
6
+ }
7
+ export interface NativeTransformResult {
8
+ code: string;
9
+ transformedCount: number;
10
+ seedUsed: number;
11
+ inoculationInjected: boolean;
12
+ stateKeyDerived: number;
13
+ }
14
+ export declare class LlvmIrTransformer {
15
+ constructor(options?: NativeProtectionOptions);
16
+ transform(irCode: string): NativeTransformResult;
17
+ }
18
+ export declare class NativeSourceTransformer {
19
+ constructor(options?: NativeProtectionOptions);
20
+ transform(sourceCode: string, lang?: NativeTargetLanguage): NativeTransformResult;
21
+ }
8
22
  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
23
  export declare function protectNativeSource(sourceCode: string, options?: NativeProtectionOptions): NativeTransformResult;
13
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
+ // [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
1
2
  export * from './types.js';
2
3
  export * from './irTransformer.js';
3
4
  export * from './nativeSourceTransformer.js';
4
5
  import { LlvmIrTransformer } from './irTransformer.js';
5
6
  import { NativeSourceTransformer } from './nativeSourceTransformer.js';
6
7
  export function protectLlvmIr(irCode, options) {
7
- function evaluateEnclaveDigest_88d3(_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:e8fbbcee-6b9452f0]",
8
+ function auditRingBufferProof_ec37(_tok0, _tok1, _tok2, _tok3) {
9
+ const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:8ef310bb-2c21e006]",
9
10
  _tokVec = [_tok0, _tok1, _tok2, _tok3];
10
11
  let _h = 2166136261;
11
12
  for (let _s = 0; _s < _tokVec.length; _s++) {
@@ -23,16 +24,16 @@ export function protectLlvmIr(irCode, options) {
23
24
  _h = (_h ^ _h >>> 16) >>> 0;
24
25
  if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
25
26
  if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
26
- if ((_h >>> 4 & 15) !== 14) {
27
+ if ((_h >>> 4 & 15) !== 4) {
27
28
  throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
28
29
  }
29
30
  return _h;
30
31
  }
31
- const __entropySeedDigest_88d3 = evaluateEnclaveDigest_88d3(1152972851, 340473297, 2093739897, 975143531);
32
- const _sgxEcallCounter_60f = new LlvmIrTransformer(options);
33
- return (__entropySeedDigest_88d3 & 255) === 230 ? _sgxEcallCounter_60f.transform(irCode) : (() => {
34
- function verifyEntropyNonceBitmask_14b7(_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:81bab515-f1a1a6f2]",
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]",
36
37
  _tokVec = [_tok0, _tok1, _tok2, _tok3];
37
38
  let _h = 2166136261;
38
39
  for (let _s = 0; _s < _tokVec.length; _s++) {
@@ -50,21 +51,21 @@ export function protectLlvmIr(irCode, options) {
50
51
  _h = (_h ^ _h >>> 16) >>> 0;
51
52
  if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
52
53
  if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
53
- if ((_h >>> 4 & 15) !== 12) {
54
+ if ((_h >>> 4 & 15) !== 2) {
54
55
  throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
55
56
  }
56
57
  return _h;
57
58
  }
58
- const __ringBufferEnvelope_14b7 = verifyEntropyNonceBitmask_14b7(1787118707, 468395087, 743629981, 1189363863);
59
- if ((__ringBufferEnvelope_14b7 & 255) !== 200) {
59
+ const __keyDerivationStateBitmask_6f7a = assertRingBufferIntegrity_6f7a(1319905289, 875373949, 1204028363, 614747439);
60
+ if ((__keyDerivationStateBitmask_6f7a & 255) !== 44) {
60
61
  throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
61
62
  }
62
63
  throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
63
64
  })();
64
65
  }
65
66
  export function protectNativeSource(sourceCode, options) {
66
- function unsealTransformer_fb3(_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:b12c0449-f74f632b]",
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]",
68
69
  _tokVec = [_tok0, _tok1, _tok2, _tok3];
69
70
  let _h = 2166136261;
70
71
  for (let _s = 0; _s < _tokVec.length; _s++) {
@@ -82,22 +83,22 @@ export function protectNativeSource(sourceCode, options) {
82
83
  _h = (_h ^ _h >>> 16) >>> 0;
83
84
  if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
84
85
  if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
85
- if ((_h >>> 4 & 15) !== 11) {
86
+ if ((_h >>> 4 & 15) !== 3) {
86
87
  throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
87
88
  }
88
89
  return _h;
89
90
  }
90
- const __tpmPcrBankBitmask_fb3 = unsealTransformer_fb3(1419688849, 1493445263, 78104697, 812686235);
91
- const _sboxTable_fb3 = [[221, 61, 114], [133, 27, 87, 59, 40, 55, 143, 236, 84, 169, 16, 3, 235, 92, 138, 103, 71], [109, 249, 47, 1, 253, 93, 133, 94, 89, 204, 27, 249, 165, 39, 109, 77]];
92
- function _sboxResolve_fb3(_slot) {
93
- const _row = _sboxTable_fb3[_slot];
94
- return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__tpmPcrBankBitmask_fb3 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
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));
95
96
  }
96
- const _SoltrixStudiosDelta_901 = options?.targetLanguage ?? _sboxResolve_fb3(20518 ^ (__tpmPcrBankBitmask_fb3 & 65535 ^ 30872));
97
- const _optionsAttestation_846 = new NativeSourceTransformer(options);
98
- return (__tpmPcrBankBitmask_fb3 & 255) === 190 ? _optionsAttestation_846.transform(sourceCode, _SoltrixStudiosDelta_901) : (() => {
99
- function attestProtectNativeSource_f92b(_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:db04ae16-3608ebba]",
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]",
101
102
  _tokVec = [_tok0, _tok1, _tok2, _tok3];
102
103
  let _h = 2166136261;
103
104
  for (let _s = 0; _s < _tokVec.length; _s++) {
@@ -115,15 +116,25 @@ export function protectNativeSource(sourceCode, options) {
115
116
  _h = (_h ^ _h >>> 16) >>> 0;
116
117
  if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
117
118
  if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
118
- if ((_h >>> 4 & 15) !== 7) {
119
- throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
119
+ if ((_h >>> 4 & 15) !== 6) {
120
+ throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
120
121
  }
121
122
  return _h;
122
123
  }
123
- const __ringBufferVector_f92b = attestProtectNativeSource_f92b(1318924869, 424483483, 1114172575, 808772947);
124
- if ((__ringBufferVector_f92b & 255) !== 117) {
124
+ const __keyDerivationStateBitmask_9ba4 = attestKernelStateNonce_9ba4(1902536873, 1163078895, 1498062035, 2049343819);
125
+ if ((__keyDerivationStateBitmask_9ba4 & 255) !== 96) {
125
126
  throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
126
127
  }
127
128
  throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
128
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)];
129
140
  }