@syferit/llvm 0.4.3 → 0.4.5
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.js +18 -18
- package/dist/irTransformer.js +247 -246
- package/dist/nativeSourceTransformer.js +145 -145
- package/dist/types.js +3 -3
- package/package.json +2 -2
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.js
CHANGED
|
@@ -9,8 +9,8 @@ export function protectLlvmIr(irCode, options) {
|
|
|
9
9
|
return transformer.transform(irCode);
|
|
10
10
|
}
|
|
11
11
|
export function protectNativeSource(sourceCode, options) {
|
|
12
|
-
function
|
|
13
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
12
|
+
function unsealSgxBoundaryEnvelope_7fe9(_tok0, _tok1, _tok2, _tok3) {
|
|
13
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:747b6947-d68a9560]",
|
|
14
14
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
15
15
|
let _h = 2166136261;
|
|
16
16
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -28,30 +28,30 @@ export function protectNativeSource(sourceCode, options) {
|
|
|
28
28
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
29
29
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
30
30
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
31
|
-
if ((_h >>> 4 & 15) !==
|
|
32
|
-
throw new Error("ASSERTION_INVARIANT:
|
|
31
|
+
if ((_h >>> 4 & 15) !== 14) {
|
|
32
|
+
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
33
33
|
}
|
|
34
34
|
return _h;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
function
|
|
39
|
-
const _row =
|
|
40
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (
|
|
36
|
+
const __ringBufferSequence_7fe9 = unsealSgxBoundaryEnvelope_7fe9(481070883, 447459623, 101606871, 1068379947);
|
|
37
|
+
const _SyferitEngineDelta_7fe9 = [[143, 109, 166], [119, 43, 139, 243, 250, 231, 187, 36, 102, 89, 124, 219, 185, 140, 222, 95, 21], [83, 9, 67, 201, 171, 141, 209, 102, 55, 252, 39, 161, 147, 87, 185, 5]];
|
|
38
|
+
function _verifySoltrixStudiosContext_7fe9(_slot) {
|
|
39
|
+
const _row = _SyferitEngineDelta_7fe9[_slot];
|
|
40
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__ringBufferSequence_7fe9 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
return (
|
|
42
|
+
const _sgxBoundaryVector_d17 = options?.targetLanguage ?? _verifySoltrixStudiosContext_7fe9(39885 ^ (__ringBufferSequence_7fe9 & 65535 ^ 25377));
|
|
43
|
+
const _monotonicNonceDrift_5d = new NativeSourceTransformer(options);
|
|
44
|
+
return (__ringBufferSequence_7fe9 & 255) === 236 ? _monotonicNonceDrift_5d.transform(sourceCode, _sgxBoundaryVector_d17) : (() => {
|
|
45
45
|
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
46
46
|
})();
|
|
47
47
|
}
|
|
48
48
|
if (typeof window !== "undefined") {
|
|
49
|
-
window.
|
|
50
|
-
syncEpoch:
|
|
51
|
-
channelSig: "
|
|
49
|
+
window.__syferitIPC_a316.invoke && window.__syferitIPC_a316.invoke("hardware:monotonic-clock-sync", {
|
|
50
|
+
syncEpoch: 320677602,
|
|
51
|
+
channelSig: "SIG_FRAME_A316"
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
56
|
-
return
|
|
54
|
+
const __syferitDispatch_c288 = [protectLlvmIr, protectNativeSource];
|
|
55
|
+
function __invoke___syferitDispatch_c288(_targetIdx, _seed) {
|
|
56
|
+
return __syferitDispatch_c288[_targetIdx + (Math.imul(Math.imul(_seed ^ 2301, 22571), Math.imul(_seed ^ 2301, 22571) + 1) & 1)];
|
|
57
57
|
}
|