@omnituum/pqc-shared 0.4.0 → 0.6.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.
- package/dist/crypto/index.cjs +91 -54
- package/dist/crypto/index.d.cts +43 -11
- package/dist/crypto/index.d.ts +43 -11
- package/dist/crypto/index.js +87 -55
- package/dist/{decrypt-eSHlbh1j.d.cts → decrypt-O1iqFIDL.d.cts} +80 -6
- package/dist/{decrypt-eSHlbh1j.d.ts → decrypt-O1iqFIDL.d.ts} +80 -6
- package/dist/fs/index.cjs +286 -147
- package/dist/fs/index.d.cts +28 -7
- package/dist/fs/index.d.ts +28 -7
- package/dist/fs/index.js +277 -147
- package/dist/index.cjs +368 -229
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +362 -230
- package/dist/{integrity-ByMp24VA.d.cts → integrity-BkBDrHA-.d.cts} +12 -4
- package/dist/{integrity-BPvNsC50.d.ts → integrity-DsFJv5c-.d.ts} +12 -4
- package/dist/{types-Dx_AFqow.d.cts → types-DmnVueAY.d.cts} +15 -5
- package/dist/{types-Dx_AFqow.d.ts → types-DmnVueAY.d.ts} +15 -5
- package/dist/utils/index.cjs +7 -10
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +7 -10
- package/dist/vault/index.cjs +8 -11
- package/dist/vault/index.d.cts +2 -2
- package/dist/vault/index.d.ts +2 -2
- package/dist/vault/index.js +8 -11
- package/package.json +19 -25
- package/src/crypto/dilithium.ts +4 -4
- package/src/crypto/hybrid.ts +182 -80
- package/src/crypto/index.ts +8 -1
- package/src/crypto/kyber.ts +20 -0
- package/src/fs/decrypt.ts +145 -68
- package/src/fs/encrypt.ts +161 -112
- package/src/fs/format.ts +110 -15
- package/src/fs/index.ts +4 -0
- package/src/fs/types.ts +77 -6
- package/src/index.ts +9 -0
- package/src/utils/integrity.ts +16 -15
- package/src/vault/manager.ts +1 -1
- package/src/version.ts +29 -7
package/dist/fs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Argon2idParams, f as OQEHeader, H as HybridKeyMaterial, P as PasswordKeyMaterial,
|
|
2
|
-
export {
|
|
1
|
+
import { A as Argon2idParams, f as OQEHeader, H as HybridKeyMaterial, g as HybridKeyMaterialV2, P as PasswordKeyMaterial, h as OQEMetadata, i as AlgorithmSuiteId, O as OQEEncryptResult, c as OQEDecryptResult } from '../decrypt-O1iqFIDL.cjs';
|
|
2
|
+
export { B as ALGORITHM_SUITES, j as DEFAULT_ARGON2ID_PARAMS, D as DecryptOptions, E as EncryptOptions, F as FileInput, r as HybridDecryptOptions, p as HybridEncryptOptions, M as MIN_ARGON2ID_PARAMS, v as OQEError, t as OQEErrorCode, o as OQEMode, z as OQE_FORMAT_VERSION, x as OQE_FORMAT_VERSION_V1, y as OQE_FORMAT_VERSION_V2, I as OQE_HEADER_SIZE, C as OQE_HEADER_SIZE_V1, G as OQE_HEADER_SIZE_V2, w as OQE_MAGIC, s as PasswordDecryptOptions, q as PasswordEncryptOptions, u as ProgressCallback, S as SUPPORTED_OQE_VERSIONS, l as combinedFileKekV2, d as decryptFile, m as decryptFileForSelf, b as decryptFileWithPassword, e as encryptFile, k as encryptFileForSelf, a as encryptFileWithPassword, n as inspectOQEFile, J as toUint8Array } from '../decrypt-O1iqFIDL.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Omnituum FS - Argon2id Key Derivation
|
|
@@ -168,17 +168,24 @@ declare function aesDecryptStreaming(encrypted: Uint8Array, key: CryptoKey | Uin
|
|
|
168
168
|
* Implements a documented, stable binary format for encrypted files.
|
|
169
169
|
*/
|
|
170
170
|
|
|
171
|
+
/** Byte length of a section's fixed header for the given format version. */
|
|
172
|
+
declare function oqeHeaderSize(version: number): number;
|
|
171
173
|
/**
|
|
172
|
-
* Write an OQE file header.
|
|
174
|
+
* Write an OQE file header. Layout depends on `header.version`: v2 appends a
|
|
175
|
+
* second 12-byte IV (the content IV) after the metadata IV.
|
|
176
|
+
*
|
|
177
|
+
* The returned bytes are also used verbatim as the AES-GCM associated data for
|
|
178
|
+
* both sections (v2), so every field here — version, suite, flags, lengths and
|
|
179
|
+
* both IVs — is authenticated and cannot be tampered with undetected.
|
|
173
180
|
*
|
|
174
181
|
* @param header - Header data
|
|
175
|
-
* @returns 30
|
|
182
|
+
* @returns Header buffer (30 bytes for v1, 42 bytes for v2)
|
|
176
183
|
*/
|
|
177
184
|
declare function writeOQEHeader(header: OQEHeader): Uint8Array;
|
|
178
185
|
/**
|
|
179
|
-
* Parse an OQE file header.
|
|
186
|
+
* Parse an OQE file header (v1 or v2).
|
|
180
187
|
*
|
|
181
|
-
* @param data - File data
|
|
188
|
+
* @param data - File data
|
|
182
189
|
* @returns Parsed header
|
|
183
190
|
* @throws OQEError if header is invalid
|
|
184
191
|
*/
|
|
@@ -202,6 +209,20 @@ declare function serializeHybridKeyMaterial(km: HybridKeyMaterial): Uint8Array;
|
|
|
202
209
|
* Parse hybrid mode key material.
|
|
203
210
|
*/
|
|
204
211
|
declare function parseHybridKeyMaterial(data: Uint8Array): HybridKeyMaterial;
|
|
212
|
+
/**
|
|
213
|
+
* Serialize v2 hybrid key material (single AND-combined wrap).
|
|
214
|
+
*
|
|
215
|
+
* Format:
|
|
216
|
+
* - X25519 ephemeral PK (32 bytes)
|
|
217
|
+
* - Kyber ciphertext length (2 bytes) + Kyber ciphertext (variable)
|
|
218
|
+
* - Content-key wrap nonce (24 bytes)
|
|
219
|
+
* - Wrapped content key length (2 bytes) + wrapped content key (variable)
|
|
220
|
+
*/
|
|
221
|
+
declare function serializeHybridKeyMaterialV2(km: HybridKeyMaterialV2): Uint8Array;
|
|
222
|
+
/**
|
|
223
|
+
* Parse v2 hybrid key material (single AND-combined wrap).
|
|
224
|
+
*/
|
|
225
|
+
declare function parseHybridKeyMaterialV2(data: Uint8Array): HybridKeyMaterialV2;
|
|
205
226
|
/**
|
|
206
227
|
* Serialize password mode key material.
|
|
207
228
|
*
|
|
@@ -397,4 +418,4 @@ declare function isFileAPIAvailable(): boolean;
|
|
|
397
418
|
*/
|
|
398
419
|
declare function isDragDropSupported(): boolean;
|
|
399
420
|
|
|
400
|
-
export { AES_GCM_IV_SIZE, AES_GCM_TAG_SIZE, AES_KEY_SIZE, AlgorithmSuiteId, Argon2idParams, HybridKeyMaterial, OQEDecryptResult, OQEEncryptResult, OQEHeader, OQEMetadata, OQE_EXTENSION, OQE_MIME_TYPE, PasswordKeyMaterial, STREAM_CHUNK_SIZE, addOQEExtension, aesDecrypt, aesDecryptCombined, aesDecryptStreaming, aesEncrypt, aesEncryptCombined, aesEncryptStreaming, assembleOQEFile, benchmarkArgon2, bytesToDataURL, copyToClipboard, createDropZone, createObjectURL, decryptResultToBlob, deriveKeyFromPassword, downloadBlob, downloadBytes, downloadDecryptedFile, downloadEncryptedFile, encryptResultToBlob, estimateArgon2Params, exportAesKey, formatFileSize, generateAesKey, generateArgon2Salt, getAlgorithmName, getFileInfo, importAesKey, isArgon2Available, isBrowser, isDragDropSupported, isFileAPIAvailable, isOQEFile, isWebCryptoAvailable, openFilePicker, openFileToEncrypt, openOQEFilePicker, parseHybridKeyMaterial, parseMetadata, parseOQEFile, parseOQEHeader, parsePasswordKeyMaterial, readFile, readFileAsDataURL, readFileAsText, removeOQEExtension, serializeHybridKeyMaterial, serializeMetadata, serializePasswordKeyMaterial, verifyPassword, writeOQEHeader };
|
|
421
|
+
export { AES_GCM_IV_SIZE, AES_GCM_TAG_SIZE, AES_KEY_SIZE, AlgorithmSuiteId, Argon2idParams, HybridKeyMaterial, HybridKeyMaterialV2, OQEDecryptResult, OQEEncryptResult, OQEHeader, OQEMetadata, OQE_EXTENSION, OQE_MIME_TYPE, PasswordKeyMaterial, STREAM_CHUNK_SIZE, addOQEExtension, aesDecrypt, aesDecryptCombined, aesDecryptStreaming, aesEncrypt, aesEncryptCombined, aesEncryptStreaming, assembleOQEFile, benchmarkArgon2, bytesToDataURL, copyToClipboard, createDropZone, createObjectURL, decryptResultToBlob, deriveKeyFromPassword, downloadBlob, downloadBytes, downloadDecryptedFile, downloadEncryptedFile, encryptResultToBlob, estimateArgon2Params, exportAesKey, formatFileSize, generateAesKey, generateArgon2Salt, getAlgorithmName, getFileInfo, importAesKey, isArgon2Available, isBrowser, isDragDropSupported, isFileAPIAvailable, isOQEFile, isWebCryptoAvailable, openFilePicker, openFileToEncrypt, openOQEFilePicker, oqeHeaderSize, parseHybridKeyMaterial, parseHybridKeyMaterialV2, parseMetadata, parseOQEFile, parseOQEHeader, parsePasswordKeyMaterial, readFile, readFileAsDataURL, readFileAsText, removeOQEExtension, serializeHybridKeyMaterial, serializeHybridKeyMaterialV2, serializeMetadata, serializePasswordKeyMaterial, verifyPassword, writeOQEHeader };
|
package/dist/fs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Argon2idParams, f as OQEHeader, H as HybridKeyMaterial, P as PasswordKeyMaterial,
|
|
2
|
-
export {
|
|
1
|
+
import { A as Argon2idParams, f as OQEHeader, H as HybridKeyMaterial, g as HybridKeyMaterialV2, P as PasswordKeyMaterial, h as OQEMetadata, i as AlgorithmSuiteId, O as OQEEncryptResult, c as OQEDecryptResult } from '../decrypt-O1iqFIDL.js';
|
|
2
|
+
export { B as ALGORITHM_SUITES, j as DEFAULT_ARGON2ID_PARAMS, D as DecryptOptions, E as EncryptOptions, F as FileInput, r as HybridDecryptOptions, p as HybridEncryptOptions, M as MIN_ARGON2ID_PARAMS, v as OQEError, t as OQEErrorCode, o as OQEMode, z as OQE_FORMAT_VERSION, x as OQE_FORMAT_VERSION_V1, y as OQE_FORMAT_VERSION_V2, I as OQE_HEADER_SIZE, C as OQE_HEADER_SIZE_V1, G as OQE_HEADER_SIZE_V2, w as OQE_MAGIC, s as PasswordDecryptOptions, q as PasswordEncryptOptions, u as ProgressCallback, S as SUPPORTED_OQE_VERSIONS, l as combinedFileKekV2, d as decryptFile, m as decryptFileForSelf, b as decryptFileWithPassword, e as encryptFile, k as encryptFileForSelf, a as encryptFileWithPassword, n as inspectOQEFile, J as toUint8Array } from '../decrypt-O1iqFIDL.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Omnituum FS - Argon2id Key Derivation
|
|
@@ -168,17 +168,24 @@ declare function aesDecryptStreaming(encrypted: Uint8Array, key: CryptoKey | Uin
|
|
|
168
168
|
* Implements a documented, stable binary format for encrypted files.
|
|
169
169
|
*/
|
|
170
170
|
|
|
171
|
+
/** Byte length of a section's fixed header for the given format version. */
|
|
172
|
+
declare function oqeHeaderSize(version: number): number;
|
|
171
173
|
/**
|
|
172
|
-
* Write an OQE file header.
|
|
174
|
+
* Write an OQE file header. Layout depends on `header.version`: v2 appends a
|
|
175
|
+
* second 12-byte IV (the content IV) after the metadata IV.
|
|
176
|
+
*
|
|
177
|
+
* The returned bytes are also used verbatim as the AES-GCM associated data for
|
|
178
|
+
* both sections (v2), so every field here — version, suite, flags, lengths and
|
|
179
|
+
* both IVs — is authenticated and cannot be tampered with undetected.
|
|
173
180
|
*
|
|
174
181
|
* @param header - Header data
|
|
175
|
-
* @returns 30
|
|
182
|
+
* @returns Header buffer (30 bytes for v1, 42 bytes for v2)
|
|
176
183
|
*/
|
|
177
184
|
declare function writeOQEHeader(header: OQEHeader): Uint8Array;
|
|
178
185
|
/**
|
|
179
|
-
* Parse an OQE file header.
|
|
186
|
+
* Parse an OQE file header (v1 or v2).
|
|
180
187
|
*
|
|
181
|
-
* @param data - File data
|
|
188
|
+
* @param data - File data
|
|
182
189
|
* @returns Parsed header
|
|
183
190
|
* @throws OQEError if header is invalid
|
|
184
191
|
*/
|
|
@@ -202,6 +209,20 @@ declare function serializeHybridKeyMaterial(km: HybridKeyMaterial): Uint8Array;
|
|
|
202
209
|
* Parse hybrid mode key material.
|
|
203
210
|
*/
|
|
204
211
|
declare function parseHybridKeyMaterial(data: Uint8Array): HybridKeyMaterial;
|
|
212
|
+
/**
|
|
213
|
+
* Serialize v2 hybrid key material (single AND-combined wrap).
|
|
214
|
+
*
|
|
215
|
+
* Format:
|
|
216
|
+
* - X25519 ephemeral PK (32 bytes)
|
|
217
|
+
* - Kyber ciphertext length (2 bytes) + Kyber ciphertext (variable)
|
|
218
|
+
* - Content-key wrap nonce (24 bytes)
|
|
219
|
+
* - Wrapped content key length (2 bytes) + wrapped content key (variable)
|
|
220
|
+
*/
|
|
221
|
+
declare function serializeHybridKeyMaterialV2(km: HybridKeyMaterialV2): Uint8Array;
|
|
222
|
+
/**
|
|
223
|
+
* Parse v2 hybrid key material (single AND-combined wrap).
|
|
224
|
+
*/
|
|
225
|
+
declare function parseHybridKeyMaterialV2(data: Uint8Array): HybridKeyMaterialV2;
|
|
205
226
|
/**
|
|
206
227
|
* Serialize password mode key material.
|
|
207
228
|
*
|
|
@@ -397,4 +418,4 @@ declare function isFileAPIAvailable(): boolean;
|
|
|
397
418
|
*/
|
|
398
419
|
declare function isDragDropSupported(): boolean;
|
|
399
420
|
|
|
400
|
-
export { AES_GCM_IV_SIZE, AES_GCM_TAG_SIZE, AES_KEY_SIZE, AlgorithmSuiteId, Argon2idParams, HybridKeyMaterial, OQEDecryptResult, OQEEncryptResult, OQEHeader, OQEMetadata, OQE_EXTENSION, OQE_MIME_TYPE, PasswordKeyMaterial, STREAM_CHUNK_SIZE, addOQEExtension, aesDecrypt, aesDecryptCombined, aesDecryptStreaming, aesEncrypt, aesEncryptCombined, aesEncryptStreaming, assembleOQEFile, benchmarkArgon2, bytesToDataURL, copyToClipboard, createDropZone, createObjectURL, decryptResultToBlob, deriveKeyFromPassword, downloadBlob, downloadBytes, downloadDecryptedFile, downloadEncryptedFile, encryptResultToBlob, estimateArgon2Params, exportAesKey, formatFileSize, generateAesKey, generateArgon2Salt, getAlgorithmName, getFileInfo, importAesKey, isArgon2Available, isBrowser, isDragDropSupported, isFileAPIAvailable, isOQEFile, isWebCryptoAvailable, openFilePicker, openFileToEncrypt, openOQEFilePicker, parseHybridKeyMaterial, parseMetadata, parseOQEFile, parseOQEHeader, parsePasswordKeyMaterial, readFile, readFileAsDataURL, readFileAsText, removeOQEExtension, serializeHybridKeyMaterial, serializeMetadata, serializePasswordKeyMaterial, verifyPassword, writeOQEHeader };
|
|
421
|
+
export { AES_GCM_IV_SIZE, AES_GCM_TAG_SIZE, AES_KEY_SIZE, AlgorithmSuiteId, Argon2idParams, HybridKeyMaterial, HybridKeyMaterialV2, OQEDecryptResult, OQEEncryptResult, OQEHeader, OQEMetadata, OQE_EXTENSION, OQE_MIME_TYPE, PasswordKeyMaterial, STREAM_CHUNK_SIZE, addOQEExtension, aesDecrypt, aesDecryptCombined, aesDecryptStreaming, aesEncrypt, aesEncryptCombined, aesEncryptStreaming, assembleOQEFile, benchmarkArgon2, bytesToDataURL, copyToClipboard, createDropZone, createObjectURL, decryptResultToBlob, deriveKeyFromPassword, downloadBlob, downloadBytes, downloadDecryptedFile, downloadEncryptedFile, encryptResultToBlob, estimateArgon2Params, exportAesKey, formatFileSize, generateAesKey, generateArgon2Salt, getAlgorithmName, getFileInfo, importAesKey, isArgon2Available, isBrowser, isDragDropSupported, isFileAPIAvailable, isOQEFile, isWebCryptoAvailable, openFilePicker, openFileToEncrypt, openOQEFilePicker, oqeHeaderSize, parseHybridKeyMaterial, parseHybridKeyMaterialV2, parseMetadata, parseOQEFile, parseOQEHeader, parsePasswordKeyMaterial, readFile, readFileAsDataURL, readFileAsText, removeOQEExtension, serializeHybridKeyMaterial, serializeHybridKeyMaterialV2, serializeMetadata, serializePasswordKeyMaterial, verifyPassword, writeOQEHeader };
|