@super-protocol/addons-tee 1.0.0 → 2.0.0

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.
Files changed (116) hide show
  1. package/bindings/nvidia-native/README.md +174 -0
  2. package/bindings/nvidia-native/package.json +26 -0
  3. package/bindings/nvidia-native/postinstall.js +40 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -28
  6. package/package.json +4 -2
  7. package/.editorconfig +0 -15
  8. package/.eslintrc.json +0 -61
  9. package/.prettierignore +0 -3
  10. package/.prettierrc +0 -15
  11. package/bindings/amd-sev-snp-napi-rs/amd-sev-snp-napi-rs.linux-x64-gnu.node +0 -0
  12. package/bindings/amd-sev-snp-napi-rs/index.d.ts +0 -51
  13. package/bindings/amd-sev-snp-napi-rs/index.js +0 -339
  14. package/bindings/amd-sev-snp-napi-rs/package-lock.json +0 -40
  15. package/bindings/sgx-native/build/Release/libmbedcrypto_gramine.so.15 +0 -0
  16. package/bindings/sgx-native/build/Release/libmbedx509_gramine.so.6 +0 -0
  17. package/bindings/sgx-native/build/Release/libsgx_dcap_quoteverify.so.1 +0 -0
  18. package/bindings/sgx-native/build/Release/libtdx_attest.so.1 +0 -0
  19. package/bindings/sgx-native/build/Release/sgx_native.node +0 -0
  20. package/bindings/sgx-native/package-lock.json +0 -23
  21. package/bindings/sp-sev/.github/auto_assign-issues.yml +0 -5
  22. package/bindings/sp-sev/.github/auto_assign.yml +0 -21
  23. package/bindings/sp-sev/.github/dependabot.yml +0 -6
  24. package/bindings/sp-sev/.github/workflows/dco.yml +0 -10
  25. package/bindings/sp-sev/.github/workflows/lint.yml +0 -56
  26. package/bindings/sp-sev/.github/workflows/test.yml +0 -215
  27. package/bindings/sp-sev/.rustfmt.toml +0 -2
  28. package/bindings/sp-sev/CODEOWNERS +0 -1
  29. package/bindings/sp-sev/Cargo.lock +0 -2461
  30. package/bindings/sp-sev/Cargo.toml +0 -80
  31. package/bindings/sp-sev/LICENSE +0 -201
  32. package/bindings/sp-sev/README.md +0 -82
  33. package/bindings/sp-sev/build.rs +0 -17
  34. package/bindings/sp-sev/docs/attestation/README.md +0 -239
  35. package/bindings/sp-sev/docs/attestation/certchain.dot +0 -14
  36. package/bindings/sp-sev/docs/attestation/certchain.dot.png +0 -0
  37. package/bindings/sp-sev/docs/attestation/prerequisites.md +0 -6
  38. package/bindings/sp-sev/docs/attestation/process.msc +0 -60
  39. package/bindings/sp-sev/docs/attestation/process.msc.png +0 -0
  40. package/bindings/sp-sev/docs/attestation/protections.md +0 -53
  41. package/bindings/sp-sev/package-version.py +0 -11
  42. package/bindings/sp-sev/tests/api.rs +0 -194
  43. package/bindings/sp-sev/tests/certs.rs +0 -142
  44. package/bindings/sp-sev/tests/certs_data/cert_chain_milan +0 -74
  45. package/bindings/sp-sev/tests/certs_data/cert_chain_turin +0 -74
  46. package/bindings/sp-sev/tests/certs_data/report_milan.hex +0 -1
  47. package/bindings/sp-sev/tests/certs_data/vcek_milan.der +0 -0
  48. package/bindings/sp-sev/tests/certs_data/vcek_turin.der +0 -0
  49. package/bindings/sp-sev/tests/guest.rs +0 -57
  50. package/bindings/sp-sev/tests/id-block.rs +0 -172
  51. package/bindings/sp-sev/tests/measurement/ovmf_AmdSev_suffix.bin +0 -0
  52. package/bindings/sp-sev/tests/measurement/ovmf_OvmfX64_suffix.bin +0 -0
  53. package/bindings/sp-sev/tests/measurement/test_auth_block.bin +0 -0
  54. package/bindings/sp-sev/tests/measurement/test_auth_key.pem +0 -6
  55. package/bindings/sp-sev/tests/measurement/test_auth_sig.bin +0 -0
  56. package/bindings/sp-sev/tests/measurement/test_id_key.pem +0 -6
  57. package/bindings/sp-sev/tests/measurement/test_id_sig.bin +0 -0
  58. package/bindings/sp-sev/tests/measurement.rs +0 -510
  59. package/bindings/sp-sev/tests/naples/ark.cert.bad +0 -0
  60. package/bindings/sp-sev/tests/naples/ark.cert.sig +0 -0
  61. package/bindings/sp-sev/tests/naples/ark.rs +0 -38
  62. package/bindings/sp-sev/tests/naples/ask.rs +0 -29
  63. package/bindings/sp-sev/tests/naples/cek.cert +0 -0
  64. package/bindings/sp-sev/tests/naples/cek.rs +0 -30
  65. package/bindings/sp-sev/tests/naples/mod.rs +0 -20
  66. package/bindings/sp-sev/tests/naples/oca.cert +0 -0
  67. package/bindings/sp-sev/tests/naples/oca.rs +0 -45
  68. package/bindings/sp-sev/tests/naples/pdh.cert +0 -0
  69. package/bindings/sp-sev/tests/naples/pdh.rs +0 -28
  70. package/bindings/sp-sev/tests/naples/pek.cert +0 -0
  71. package/bindings/sp-sev/tests/naples/pek.rs +0 -32
  72. package/bindings/sp-sev/tests/rome/ark.rs +0 -33
  73. package/bindings/sp-sev/tests/rome/ask.rs +0 -29
  74. package/bindings/sp-sev/tests/rome/cek.cert +0 -0
  75. package/bindings/sp-sev/tests/rome/cek.rs +0 -29
  76. package/bindings/sp-sev/tests/rome/mod.rs +0 -16
  77. package/bindings/sp-sev/tests/rome/oca.cert +0 -0
  78. package/bindings/sp-sev/tests/rome/oca.rs +0 -45
  79. package/bindings/sp-sev/tests/rome/pdh.cert +0 -0
  80. package/bindings/sp-sev/tests/rome/pdh.rs +0 -28
  81. package/bindings/sp-sev/tests/rome/pek.cert +0 -0
  82. package/bindings/sp-sev/tests/rome/pek.rs +0 -32
  83. package/bindings/sp-sev/tests/session.rs +0 -39
  84. package/bindings/sp-sev/tests/sev_launch.rs +0 -120
  85. package/bindings/sp-sev/tests/snp_launch.rs +0 -108
  86. package/bindings/utils/virtee/LICENSE +0 -201
  87. package/bindings/utils/virtee/libsev.so +0 -0
  88. package/bindings/utils/virtee/snpguest +0 -0
  89. package/dist/proto/AmdSevSnp.d.ts +0 -194
  90. package/dist/proto/AmdSevSnp.js +0 -363
  91. package/dist/sgx-native-module/consts.d.ts +0 -24
  92. package/dist/sgx-native-module/consts.js +0 -38
  93. package/dist/sgx-native-module/dcap-quote-verify.service.d.ts +0 -12
  94. package/dist/sgx-native-module/dcap-quote-verify.service.js +0 -84
  95. package/dist/sgx-native-module/enclave.service.d.ts +0 -93
  96. package/dist/sgx-native-module/enclave.service.js +0 -211
  97. package/dist/sgx-native-module/errors.d.ts +0 -19
  98. package/dist/sgx-native-module/errors.js +0 -69
  99. package/dist/sgx-native-module/helpers.d.ts +0 -1
  100. package/dist/sgx-native-module/helpers.js +0 -50
  101. package/dist/sgx-native-module/index.d.ts +0 -9
  102. package/dist/sgx-native-module/index.js +0 -26
  103. package/dist/sgx-native-module/pki.service.d.ts +0 -50
  104. package/dist/sgx-native-module/pki.service.js +0 -74
  105. package/dist/sgx-native-module/sev-snp-mrenclave.d.ts +0 -59
  106. package/dist/sgx-native-module/sev-snp-mrenclave.js +0 -322
  107. package/dist/sgx-native-module/sev-snp-schema.d.ts +0 -22
  108. package/dist/sgx-native-module/sev-snp-schema.js +0 -24
  109. package/dist/sgx-native-module/sev-snp.d.ts +0 -127
  110. package/dist/sgx-native-module/sev-snp.js +0 -513
  111. package/dto/src/AmdSevSnp.proto +0 -31
  112. package/dto/src/Compression.proto +0 -11
  113. package/dto/src/Hash.proto +0 -6
  114. package/dto/src/OrderReport.proto +0 -21
  115. package/dto/src/TRI.proto +0 -22
  116. package/dto/src/TeeDeviceInfo.proto +0 -46
@@ -0,0 +1,174 @@
1
+ # NVIDIA Native Attestation Module
2
+
3
+ Node.js native addon for GPU attestation using NVIDIA Attestation SDK.
4
+
5
+ ## Features
6
+
7
+ - **Remote Attestation via NRAS**: Generate JWT tokens via NVIDIA Remote Attestation Service
8
+ - **Policy Verification**: Verify JWT with Rego policies
9
+ - **Device Topology**: Retrieve GPU and NVSwitch counts with dynamic library loading
10
+ - **Device Information**: Get NVIDIA GPU device information
11
+ - **TypeScript Support**: Full type support
12
+
13
+ ## Dependencies
14
+
15
+ ### Runtime (System Libraries)
16
+
17
+ ```bash
18
+ # Ubuntu/Debian
19
+ sudo apt-get install -y \
20
+ libcurl4-openssl-dev \
21
+ libxml2-dev \
22
+ libssl-dev \
23
+ libxmlsec1-dev \
24
+ libxmlsec1-openssl
25
+ ```
26
+
27
+ ### Build Dependencies
28
+
29
+ ```bash
30
+ sudo apt-get install -y build-essential cmake git python3
31
+ ```
32
+
33
+ ### NVIDIA Attestation SDK
34
+
35
+ The SDK is included as a git submodule and is built automatically on first build.
36
+
37
+ ## Build
38
+
39
+ ```bash
40
+ # 1. Initialize submodules
41
+ git submodule update --init --recursive
42
+
43
+ # 2. Build
44
+ ./build.sh
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ ### TypeScript (Recommended)
50
+
51
+ ```typescript
52
+ import {
53
+ NvidiaAttestationService,
54
+ PERMISSIVE_POLICY
55
+ } from 'tee-addon';
56
+
57
+ const service = new NvidiaAttestationService();
58
+
59
+ // Attestation via NRAS
60
+ const result = await service.attestGpuWithNRAS({
61
+ serviceKey: 'your-api-key'
62
+ });
63
+
64
+ console.log('Success:', result.success);
65
+ console.log('JWT:', result.jwt);
66
+ console.log('Claims:', result.claims);
67
+ ```
68
+
69
+ ### Native C++
70
+
71
+ ```javascript
72
+ const { TNvidiaAttestation } = require('./build/Release/nvidia_native.node');
73
+
74
+ const attestation = new TNvidiaAttestation();
75
+ const nonce = Buffer.alloc(32);
76
+ const result = attestation.attestGpuWithNRAS(nonce);
77
+ console.log(result.success, result.jwt, result.claims);
78
+ ```
79
+
80
+ ## API Reference
81
+
82
+ ### generateNonce(nonceLength?)
83
+
84
+ Generates a cryptographic nonce via NVIDIA Attestation SDK.
85
+
86
+ **Parameters**:
87
+ - `nonceLength?: number` — length in bytes (default `32`)
88
+
89
+ **Returns**: `Buffer`
90
+
91
+ ### attestGpuWithNRAS(nonce?, serviceKey?, nrasUrl?)
92
+
93
+ Performs GPU attestation via NRAS.
94
+
95
+ **Returns**: `{success: boolean, jwt: string, claims: string}`
96
+
97
+ ### attestNvSwitchWithNRAS(nonce?, serviceKey?, nrasUrl?)
98
+
99
+ Performs NVSwitch attestation via NRAS.
100
+
101
+ **Returns**: `{success: boolean, jwt: string, claims: string}`
102
+
103
+ ### verifyJwt(jwt, serviceKey?, nrasUrl?)
104
+
105
+ Verifies detached EAT JWT cryptographically via NRAS and returns decoded claims.
106
+
107
+ **Returns**: `{result: boolean, claims: string, msg: string, logs: string}`
108
+
109
+ **Behavior**:
110
+ - Returns `{result: true, claims, msg: "Success"}` when cryptographic verification succeeds
111
+ - Returns `{result: false, claims, msg: "Attestation overall result is false"}` when verification reaches decision stage but overall result is false
112
+ - Throws `TypeError` for invalid input argument types/shape
113
+ - Throws `Error` for hard failures (malformed/invalid JWT payload, validate/decode failure, claims extraction/serialization failure, HTTP/JWKS processing failure)
114
+
115
+ ### evaluatePolicy(claims, regoPolicy)
116
+
117
+ Evaluates attestation claims against a Rego policy and returns policy diagnostics.
118
+
119
+ **Returns**: `{result: boolean, msg: string, details: string[], logs: string}`
120
+
121
+ **Behavior**:
122
+ - Returns `{result: true, msg: "Success", details: []}` when claims match the policy
123
+ - Returns `{result: false, msg, details}` when claims do not match the policy, with failed rule names in `details`
124
+ - Throws `TypeError` for invalid input argument types/shape
125
+ - Throws `Error` for policy evaluation failures
126
+
127
+ ### getDeviceTopology()
128
+
129
+ Retrieves NVIDIA device topology information (GPU and NVSwitch).
130
+
131
+ Dynamically loads NVML and NSCQ libraries, gets device counts, and unloads libraries automatically.
132
+
133
+ **Parameters**: None
134
+
135
+ **Returns**: `{gpuCount: number, nvswitchCount: number}`
136
+
137
+ **Throws**: Error if libraries are loaded but data retrieval fails
138
+
139
+ **Example**:
140
+ ```javascript
141
+ const topology = attestation.getDeviceTopology();
142
+ console.log(`GPUs: ${topology.gpuCount}`);
143
+ console.log(`NVSwitches: ${topology.nvswitchCount}`);
144
+ ```
145
+
146
+ **Error Handling**:
147
+ ```javascript
148
+ try {
149
+ const topology = attestation.getDeviceTopology();
150
+ console.log(`Found ${topology.gpuCount} GPUs and ${topology.nvswitchCount} NVSwitches`);
151
+ } catch (error) {
152
+ console.error('Failed to get topology:', error.message);
153
+ }
154
+ ```
155
+
156
+ **Notes**:
157
+ - Requires NVIDIA Driver with NVML support
158
+ - NVSwitch requires NSCQ library (optional)
159
+ - Returns 0 if libraries are not installed (graceful degradation)
160
+ - Throws if libraries are loaded but data retrieval fails
161
+
162
+ ### getDeviceInfo()
163
+
164
+ Retrieves device information.
165
+
166
+ **Returns**: `{deviceId: string, vendor: string, attestationSupported: boolean}`
167
+
168
+ ## See also
169
+
170
+ See the main project README for full documentation.
171
+
172
+ ## License
173
+
174
+ ISC
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "nvidia-native",
3
+ "version": "1.0.0",
4
+ "description": "Native Node.js addon for NVIDIA attestation",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node-gyp rebuild",
8
+ "build": "node-gyp rebuild",
9
+ "clean": "node-gyp clean"
10
+ },
11
+ "gypfile": true,
12
+ "dependencies": {
13
+ "node-addon-api": "^5.0.0"
14
+ },
15
+ "devDependencies": {
16
+ "node-gyp": "^9.0.0"
17
+ },
18
+ "keywords": [
19
+ "nvidia",
20
+ "attestation",
21
+ "tee",
22
+ "native"
23
+ ],
24
+ "author": "",
25
+ "license": "ISC"
26
+ }
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const releaseDir = path.join(__dirname, 'build', 'Release');
7
+ const libFile = 'libnvat.so.1.1.0';
8
+ const libPath = path.join(releaseDir, libFile);
9
+
10
+ if (!fs.existsSync(libPath)) {
11
+ console.error(`FATAL: Required library not found: ${libPath}`);
12
+ process.exit(1);
13
+ }
14
+
15
+ const symlink1 = path.join(releaseDir, 'libnvat.so.1');
16
+ const symlink2 = path.join(releaseDir, 'libnvat.so');
17
+
18
+ // Create symlink libnvat.so.1 -> libnvat.so.1.1.0
19
+ try {
20
+ if (fs.existsSync(symlink1)) {
21
+ fs.unlinkSync(symlink1);
22
+ }
23
+ fs.symlinkSync(libFile, symlink1);
24
+ console.log('Created symlink: libnvat.so.1 -> libnvat.so.1.1.0');
25
+ } catch (err) {
26
+ console.error(`FATAL: Failed to create symlink ${symlink1}: ${err.message}`);
27
+ process.exit(1);
28
+ }
29
+
30
+ // Create symlink libnvat.so -> libnvat.so.1
31
+ try {
32
+ if (fs.existsSync(symlink2)) {
33
+ fs.unlinkSync(symlink2);
34
+ }
35
+ fs.symlinkSync('libnvat.so.1', symlink2);
36
+ console.log('Created symlink: libnvat.so -> libnvat.so.1');
37
+ } catch (err) {
38
+ console.error(`FATAL: Failed to create symlink ${symlink2}: ${err.message}`);
39
+ process.exit(1);
40
+ }
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * as SgxNative from "./sgx-native-module";
1
+ export {};
package/dist/index.js CHANGED
@@ -1,28 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SgxNative = void 0;
27
- exports.SgxNative = __importStar(require("./sgx-native-module"));
28
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxpRUFBaUQifQ==
1
+ module.exports = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-protocol/addons-tee",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "The TEE trusted loader addons",
5
5
  "tags": [
6
6
  "tee"
@@ -26,7 +26,9 @@
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsc -p tsconfig.build.json",
29
- "build:clean": "rm -rf ./dist && tsc -p tsconfig.build.json",
29
+ "postbuild": "mkdir -p dist/nvidia-native-module && cp src/nvidia-native-module/*.rego dist/nvidia-native-module/",
30
+ "build:clean": "rm -rf ./dist && npm run build",
31
+ "postinstall": "node bindings/nvidia-native/postinstall.js",
30
32
  "lint": "eslint --ext .ts src",
31
33
  "lint:fix": "eslint --ext .ts src --fix",
32
34
  "start": "yarn build",
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- trim_trailing_whitespace = true
7
- insert_final_newline = true
8
-
9
- [*.md]
10
- insert_final_newline = true
11
- trim_trailing_whitespace = true
12
-
13
- [*.{js,jsx,json,ts,tsx,yml}]
14
- indent_size = 2
15
- indent_style = space
package/.eslintrc.json DELETED
@@ -1,61 +0,0 @@
1
- {
2
- "env": {
3
- "node": true,
4
- "es2021": true
5
- },
6
- "extends": [
7
- "eslint:recommended",
8
- "plugin:@typescript-eslint/recommended",
9
- "plugin:prettier/recommended"
10
- ],
11
- "globals": {
12
- "Atomics": "readonly",
13
- "SharedArrayBuffer": "readonly"
14
- },
15
- "parser": "@typescript-eslint/parser",
16
- "parserOptions": {
17
- "project": ["./tsconfig.json"]
18
- },
19
- "plugins": [
20
- "@typescript-eslint"
21
- ],
22
- "rules": {
23
- "@typescript-eslint/ban-ts-comment": ["warn"],
24
- "@typescript-eslint/no-var-requires": ["off"],
25
- "@typescript-eslint/no-unused-vars": ["off"],
26
- "@typescript-eslint/interface-name-prefix": ["off"],
27
- "@typescript-eslint/no-empty-function": ["warn"],
28
- "comma-dangle": [
29
- "error",
30
- {
31
- "arrays": "always-multiline",
32
- "objects": "always-multiline",
33
- "imports": "always-multiline",
34
- "exports": "always-multiline",
35
- "functions": "always-multiline"
36
- }
37
- ],
38
- "linebreak-style": [
39
- "error",
40
- "unix"
41
- ],
42
- "newline-before-return": "warn",
43
- "no-cond-assign": "error",
44
- "no-console": "warn",
45
- "no-mixed-operators": "warn",
46
- "no-constant-condition": [
47
- "error", {
48
- "checkLoops": false
49
- }],
50
- "no-extra-boolean-cast": "off",
51
- "no-multiple-empty-lines": ["error", {
52
- "max": 1,
53
- "maxEOF": 0
54
- }],
55
- "object-curly-spacing": ["error", "always"],
56
- "object-property-newline": ["error", {
57
- "allowAllPropertiesOnSameLine": false
58
- }],
59
- "semi": ["error", "always"]
60
- }
61
- }
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- dist/**/*
2
- bindings/**/*
3
- **/gen/*
package/.prettierrc DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "singleQuote": false,
3
- "trailingComma": "all",
4
- "tabWidth": 4,
5
- "printWidth": 120,
6
- "useTabs": false,
7
- "overrides": [
8
- {
9
- "files": "*.ts",
10
- "options": {
11
- "parser": "typescript"
12
- }
13
- }
14
- ]
15
- }
@@ -1,51 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- /* auto-generated by NAPI-RS */
5
-
6
- export const SNP_REPORT_DATA_SIZE: number
7
- export const KDS_CERT_SITE: string
8
- export const KDS_VCEK: string
9
- export const SHA256_BUFFER_SIZE: number
10
- export const ARK_MILAN_PEM: Uint8Array
11
- export const ARK_GENOA_PEM: Uint8Array
12
- export const ARK_TURIN_PEM: Uint8Array
13
- export const ASK_MILAN_PEM: Uint8Array
14
- export const ASK_GENOA_PEM: Uint8Array
15
- export const ASK_TURIN_PEM: Uint8Array
16
- /** Well-known AMD SEV-SNP code names as JS string enum. */
17
- export enum WellKnownSnpCodeNames {
18
- Milan = 'Milan',
19
- Genoa = 'Genoa',
20
- Turin = 'Turin'
21
- }
22
- export interface CpuInfo {
23
- family: number
24
- model: number
25
- stepping: number
26
- }
27
- export interface ImportantSecurityFields {
28
- vmpl: number
29
- debugAllowed: boolean
30
- ciphertextHiding: boolean
31
- pageSwapDisabled: boolean
32
- snp: number
33
- }
34
- export const IMPORTANT_SECURITY_FIELDS_DUMMY: ImportantSecurityFields
35
- export declare function getSnpReport(data: Buffer, vmpl: number): Buffer
36
- export declare function getVcekKdsUrl(report: Buffer, generation: string): string
37
- export declare function getReportData(report: Buffer): Buffer
38
- export declare function getReportMeasure(report: Buffer): Buffer
39
- export declare function getReportVmpl(report: Buffer): number
40
- export declare function getReportPolicy(report: Buffer): bigint
41
- export declare function getReportImportantSecurityFields(report: Buffer): ImportantSecurityFields
42
- export declare function getReportCpuInfo(report: Buffer): CpuInfo
43
- /**
44
- * Identify EPYC generation from provided CpuInfo (family/model).
45
- * Returns a `WellKnownSnpCodeNames` enum for known SNP generations.
46
- */
47
- export declare function getCpuGeneration(cpuInfo: CpuInfo): WellKnownSnpCodeNames
48
- export declare function getCpuInfo(): CpuInfo
49
- export declare function getCpuSig(cpuInfo: CpuInfo): number
50
- export declare function getLogicalCoresCount(): number
51
- export declare function calcSnpMeasure(ovmfPath: string, kernelSha256: Buffer, initrdSha256: Buffer, cmdlineSha256: Buffer, vcpuSig: number, vcpuCount: number): Buffer