@digitaldefiance/ecies-lib 4.19.10 → 4.19.12
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 +214 -121
- package/package.json +1 -1
- package/src/enumerations/id-provider-error-type.d.ts +5 -1
- package/src/enumerations/id-provider-error-type.d.ts.map +1 -1
- package/src/enumerations/id-provider-error-type.js +4 -0
- package/src/enumerations/id-provider-error-type.js.map +1 -1
- package/src/interfaces/id-provider.d.ts +8 -0
- package/src/interfaces/id-provider.d.ts.map +1 -1
- package/src/lib/base-id-provider.d.ts +1 -0
- package/src/lib/base-id-provider.d.ts.map +1 -1
- package/src/lib/base-id-provider.js.map +1 -1
- package/src/lib/guid-provider-utils.d.ts +29 -0
- package/src/lib/guid-provider-utils.d.ts.map +1 -0
- package/src/lib/guid-provider-utils.js +70 -0
- package/src/lib/guid-provider-utils.js.map +1 -0
- package/src/lib/guid.d.ts +0 -31
- package/src/lib/guid.d.ts.map +1 -1
- package/src/lib/guid.js +0 -69
- package/src/lib/guid.js.map +1 -1
- package/src/lib/id-providers/custom-provider.d.ts +1 -0
- package/src/lib/id-providers/custom-provider.d.ts.map +1 -1
- package/src/lib/id-providers/custom-provider.js +13 -0
- package/src/lib/id-providers/custom-provider.js.map +1 -1
- package/src/lib/id-providers/guidv4-provider.d.ts +1 -0
- package/src/lib/id-providers/guidv4-provider.d.ts.map +1 -1
- package/src/lib/id-providers/guidv4-provider.js +12 -0
- package/src/lib/id-providers/guidv4-provider.js.map +1 -1
- package/src/lib/id-providers/objectid-provider.d.ts +1 -0
- package/src/lib/id-providers/objectid-provider.d.ts.map +1 -1
- package/src/lib/id-providers/objectid-provider.js +14 -0
- package/src/lib/id-providers/objectid-provider.js.map +1 -1
- package/src/lib/id-providers/uint8array-provider.d.ts +1 -0
- package/src/lib/id-providers/uint8array-provider.d.ts.map +1 -1
- package/src/lib/id-providers/uint8array-provider.js +12 -0
- package/src/lib/id-providers/uint8array-provider.js.map +1 -1
- package/src/lib/id-providers/uuid-provider.d.ts +1 -0
- package/src/lib/id-providers/uuid-provider.d.ts.map +1 -1
- package/src/lib/id-providers/uuid-provider.js +18 -0
- package/src/lib/id-providers/uuid-provider.js.map +1 -1
- package/src/lib/index.d.ts +1 -0
- package/src/lib/index.d.ts.map +1 -1
- package/src/lib/index.js +1 -0
- package/src/lib/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -1530,176 +1530,171 @@ A: Yes. Use `EncryptionStream` for memory-efficient processing of files of any s
|
|
|
1530
1530
|
|
|
1531
1531
|
## ChangeLog
|
|
1532
1532
|
|
|
1533
|
-
### Recent Versions
|
|
1534
|
-
|
|
1535
|
-
**v4.18.0** - Threshold voting
|
|
1536
|
-
**v4.16.x** - Voting key derivation security improvements, HKDF RFC 5869 compliance
|
|
1537
|
-
**v4.13.0** - API naming improvements (SIMPLE→BASIC, SINGLE→WITH_LENGTH)
|
|
1538
|
-
**v4.12.0** - AESGCMService refactoring, JSON encryption
|
|
1539
|
-
**v4.10.7** - Strong typing for ID providers
|
|
1540
|
-
**v4.10.6** - Complete cryptographic voting system (15+ methods)
|
|
1541
|
-
**v4.0.0** - ECIES Protocol v4.0 (breaking changes)
|
|
1542
|
-
**v3.7.0** - Pluggable ID provider system
|
|
1543
|
-
**v3.0.0** - Streaming encryption
|
|
1544
|
-
|
|
1545
1533
|
### Breaking Changes Summary
|
|
1546
1534
|
|
|
1547
|
-
**v4.
|
|
1548
|
-
**v4.
|
|
1549
|
-
**v4.
|
|
1535
|
+
- **v4.19.0**: Version syncs, id-provider improvements
|
|
1536
|
+
- **v4.13.0**: Encryption mode renaming (`SIMPLE`→`BASIC`, `SINGLE`→`WITH_LENGTH`), `Guid` class renamed to `GuidUint8Array`
|
|
1537
|
+
- **v4.12.0**: `AESGCMService` changed from abstract static class to instance-based
|
|
1538
|
+
- **v4.0.0**: ECIES protocol v4.0 — HKDF key derivation, AAD binding, compressed keys, new IV/key sizes
|
|
1539
|
+
- **v3.0.0**: Streaming encryption API, pluggable ID providers, i18n v2 architecture
|
|
1550
1540
|
|
|
1551
|
-
|
|
1541
|
+
---
|
|
1552
1542
|
|
|
1553
|
-
|
|
1543
|
+
### Versions 4.19.x (v4.19.0 – v4.19.11)
|
|
1554
1544
|
|
|
1555
|
-
|
|
1545
|
+
**Guid improvements, `parseSafe`, provider-to-GUID conversion**
|
|
1556
1546
|
|
|
1557
|
-
|
|
1547
|
+
- Added `parseSafe(str)` method to `IIdProvider` and all providers — returns `undefined` instead of throwing on invalid input, useful for parsing user input safely
|
|
1548
|
+
- New `guid-provider-utils.ts` module with `fromProviderId()` and `fromProviderIdBytes()` — deterministic conversion from any provider's native ID to `GuidUint8Array` using UUID v5 namespaces
|
|
1549
|
+
- All ID providers (`GuidV4Provider`, `ObjectIdProvider`, `UuidProvider`, `CustomIdProvider`, `Uint8ArrayIdProvider`) implement `parseSafe`
|
|
1550
|
+
- `TypedConfiguration` updated with new provider utility support
|
|
1551
|
+
- Threshold key generator PBT spec improvements
|
|
1552
|
+
|
|
1553
|
+
### Version 4.18.0 (v4.18.8)
|
|
1554
|
+
|
|
1555
|
+
**Threshold voting system**
|
|
1556
|
+
|
|
1557
|
+
- **Threshold Decryption Module**: Complete implementation of Damgård et al.'s threshold Paillier scheme for distributed vote tallying — no single party can decrypt votes alone
|
|
1558
|
+
- **ThresholdKeyGenerator**: Generate k-of-n threshold key pairs with configurable bit length (default 2048)
|
|
1559
|
+
- **GuardianRegistry**: Register, query, and manage Guardians with status tracking and backup designation
|
|
1560
|
+
- **CeremonyCoordinator**: Orchestrate decryption ceremonies where k Guardians submit partial decryptions with zero-knowledge proofs
|
|
1561
|
+
- **IntervalScheduler**: Configurable interval decryption (time-based, vote-count-based, or hybrid) for real-time running tallies
|
|
1562
|
+
- **PublicTallyFeed**: Real-time subscription API publishing verified interval tallies with cryptographic proofs
|
|
1563
|
+
- **TallyVerifier**: Verify interval tally integrity with ZK proof validation
|
|
1564
|
+
- **ThresholdAuditLog**: Cryptographic hash chain audit log for threshold operations
|
|
1565
|
+
- **ThresholdPollFactory**: Create threshold-enabled polls with the same voting API as standard polls
|
|
1566
|
+
- **Hierarchical Aggregators**: Precinct → County → State → National aggregation for threshold polls
|
|
1567
|
+
- Comprehensive PBT and unit test suites for all threshold components (10,700+ lines added)
|
|
1568
|
+
- Migration guide (`THRESHOLD-MIGRATION.md`) and security documentation (`THRESHOLD-SECURITY.md`)
|
|
1569
|
+
|
|
1570
|
+
### Versions 4.17.x (v4.17.0 – v4.17.10)
|
|
1571
|
+
|
|
1572
|
+
**i18n component package isolation, README expansion**
|
|
1573
|
+
|
|
1574
|
+
- Added `i18n-setup.ts` export for component-level i18n engine initialization
|
|
1575
|
+
- New `i18n-component-package.spec.ts` test suite for verifying i18n isolation
|
|
1576
|
+
- Major README expansion (~400 lines of documentation updates)
|
|
1577
|
+
- Version bumps and package dependency updates
|
|
1578
|
+
|
|
1579
|
+
### Versions 4.16.x (v4.16.0 – v4.16.30)
|
|
1580
|
+
|
|
1581
|
+
**Voting key derivation security, HKDF RFC 5869 compliance, i18n string key migration**
|
|
1582
|
+
|
|
1583
|
+
- **v4.16.0**: Use uncompressed voting keys in HKDF derivation for improved security
|
|
1584
|
+
- Migrated all `engine.translate(EciesComponentId, key)` calls to `engine.translateStringKey(key)` — removed `EciesComponentId` parameter throughout the codebase
|
|
1585
|
+
- Updated all error classes (`CryptoError`, `GuidError`, `ECIESError`, etc.) to use `translateStringKey`
|
|
1586
|
+
- Updated builders (`MemberBuilder`, `ECIESBuilder`), constants, and services
|
|
1587
|
+
- `EciesStringKey` enumeration expanded with new string keys
|
|
1588
|
+
- i18n string key migration test suite (`i18n-string-key-migration.spec.ts`, 400+ lines)
|
|
1589
|
+
- Guid spec improvements and timing attack resistance test updates
|
|
1590
|
+
- Showcase application updates across multiple patch versions
|
|
1591
|
+
|
|
1592
|
+
### Versions 4.15.x (v4.15.0 – v4.15.6)
|
|
1593
|
+
|
|
1594
|
+
**Error class refactoring, i18n translation updates, showcase improvements**
|
|
1595
|
+
|
|
1596
|
+
- Refactored all error classes (`CryptoError`, `ECIESError`, `GuidError`, `IdProviderError`, `InvalidEmailError`, `LengthError`, `MemberError`, `Pbkdf2Error`, `SecureStorageError`, `SimpleEciesError`, `DisposedError`) with improved i18n integration
|
|
1597
|
+
- `EciesStringKey` enumeration significantly expanded and reorganized
|
|
1598
|
+
- Updated `de` and `fr` translation files (~750 lines each reorganized)
|
|
1599
|
+
- Constants and invariant validator updates
|
|
1600
|
+
- `crypto-core.ts` and `signature.ts` improvements
|
|
1601
|
+
- `password-login.ts` refactored
|
|
1602
|
+
- Showcase application dependency updates (Vite config, yarn.lock, CSS)
|
|
1603
|
+
|
|
1604
|
+
### Versions 4.14.x (v4.14.0 – v4.14.3)
|
|
1605
|
+
|
|
1606
|
+
**Module independence testing, Guid spec hardening**
|
|
1558
1607
|
|
|
1559
|
-
-
|
|
1608
|
+
- Enhanced module independence tests (`constants-independence`, `interface-type-imports`, `secure-storage-independence`)
|
|
1609
|
+
- Property-based test (PBT) specs for module independence validation
|
|
1610
|
+
- Expanded Guid spec with 58+ lines of new test cases
|
|
1611
|
+
- `secure-storage-id-provider.spec.ts` and `secure-storage-independence.spec.ts` improvements
|
|
1612
|
+
- Jest config and package dependency updates
|
|
1613
|
+
|
|
1614
|
+
### Version 4.13.0 (v4.13.0 – v4.13.8)
|
|
1615
|
+
|
|
1616
|
+
**API naming improvements (SIMPLE→BASIC, SINGLE→WITH_LENGTH), Guid→GuidUint8Array**
|
|
1617
|
+
|
|
1618
|
+
**Breaking Changes:**
|
|
1619
|
+
- **Encryption Mode Renaming**:
|
|
1560
1620
|
- `SIMPLE` → `BASIC` (constant)
|
|
1561
1621
|
- `SINGLE` → `WITH_LENGTH` (constant)
|
|
1562
1622
|
- `encryptSimpleOrSingle(isSimple, ...)` → `encryptBasic(...)` / `encryptWithLength(...)`
|
|
1563
1623
|
- `decryptSimpleOrSingleWithHeader(isSimple, ...)` → `decryptBasicWithHeader(...)` / `decryptWithLengthAndHeader(...)`
|
|
1564
|
-
|
|
1565
|
-
- **
|
|
1566
|
-
- `OBJECT_ID_LENGTH` removed - use `idProvider.byteLength` instead
|
|
1567
|
-
|
|
1568
|
-
- **Guid Class Renamed**:
|
|
1569
|
-
- `Guid` → `GuidUint8Array` (browser implementation)
|
|
1624
|
+
- **Removed Constants**: `OBJECT_ID_LENGTH` removed — use `idProvider.byteLength` instead
|
|
1625
|
+
- **Guid Class Renamed**: `Guid` → `GuidUint8Array` (browser implementation)
|
|
1570
1626
|
- Added `VersionedGuidUint8Array<V>` type for compile-time version tracking
|
|
1571
|
-
- Methods like `generate()`, `parse()`, `hydrate()` now return `VersionedGuidUint8Array`
|
|
1572
1627
|
|
|
1573
1628
|
**New Features:**
|
|
1574
|
-
|
|
1575
|
-
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
-
|
|
1579
|
-
```typescript
|
|
1580
|
-
throw new TranslatableEciesError('INVALID_KEY', { keyLength: 32 });
|
|
1581
|
-
```
|
|
1582
|
-
|
|
1583
|
-
- **Enhanced Type System for GUIDs**:
|
|
1584
|
-
- `VersionedGuidUint8Array<4>` for v4 UUIDs with compile-time version info
|
|
1585
|
-
- `__version` property attached to parsed/generated GUIDs
|
|
1629
|
+
- `ECIES_CONFIG`: New configuration interface and constant for ECIES parameters
|
|
1630
|
+
- `TranslatableEciesError`: New error class with automatic i18n translation
|
|
1631
|
+
- Enhanced type system for GUIDs with `VersionedGuidUint8Array<4>` and `__version` property
|
|
1632
|
+
- Massive refactoring across 128 source files (2,250 insertions, 569 deletions)
|
|
1633
|
+
- JSDoc improvements, production build support, lint fixes
|
|
1586
1634
|
|
|
1587
1635
|
**Migration Guide:**
|
|
1588
1636
|
```typescript
|
|
1589
1637
|
// BEFORE (v4.12.x)
|
|
1590
|
-
const encrypted = await ecies.encryptSimpleOrSingle(false, publicKey, data);
|
|
1638
|
+
const encrypted = await ecies.encryptSimpleOrSingle(false, publicKey, data);
|
|
1591
1639
|
const decrypted = await ecies.decryptSimpleOrSingleWithHeader(false, privateKey, encrypted);
|
|
1592
1640
|
|
|
1593
|
-
const encrypted2 = await ecies.encryptSimpleOrSingle(true, publicKey, data); // "simple" mode
|
|
1594
|
-
const decrypted2 = await ecies.decryptSimpleOrSingleWithHeader(true, privateKey, encrypted2);
|
|
1595
|
-
|
|
1596
1641
|
// AFTER (v4.13.0+)
|
|
1597
|
-
const encrypted = await ecies.encryptWithLength(publicKey, data);
|
|
1642
|
+
const encrypted = await ecies.encryptWithLength(publicKey, data);
|
|
1598
1643
|
const decrypted = await ecies.decryptWithLengthAndHeader(privateKey, encrypted);
|
|
1599
|
-
|
|
1600
|
-
const encrypted2 = await ecies.encryptBasic(publicKey, data); // Basic mode (formerly "simple")
|
|
1601
|
-
const decrypted2 = await ecies.decryptBasicWithHeader(privateKey, encrypted2);
|
|
1602
1644
|
```
|
|
1603
1645
|
|
|
1604
|
-
### v4.12.0
|
|
1646
|
+
### Version 4.12.0 (v4.12.0 – v4.12.8)
|
|
1647
|
+
|
|
1648
|
+
**AESGCMService refactoring, JSON encryption, CRC service, stream transforms**
|
|
1605
1649
|
|
|
1606
1650
|
**Breaking Changes:**
|
|
1607
1651
|
- **AESGCMService is now instance-based**: Changed from abstract static class to regular instance-based class
|
|
1608
1652
|
- All methods are now instance methods instead of static methods
|
|
1609
1653
|
- Constructor accepts optional `IConstants` parameter for configuration
|
|
1610
|
-
- Example: `const aesGcm = new AESGCMService(); aesGcm.encrypt(...)` instead of `AESGCMService.encrypt(...)`
|
|
1611
1654
|
|
|
1612
1655
|
**New Features:**
|
|
1613
|
-
- **JSON Encryption Methods**:
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
**Architecture Improvements:**
|
|
1620
|
-
- Added `configuration` and `engine` instance properties to AESGCMService
|
|
1621
|
-
- Improved dependency injection support with optional constants parameter
|
|
1622
|
-
- Enhanced error handling with i18n support
|
|
1623
|
-
- Better alignment with browser/Node.js architectural patterns
|
|
1656
|
+
- **JSON Encryption Methods**: `encryptJson<T>()` and `decryptJson<T>()` for convenient typed JSON encryption/decryption
|
|
1657
|
+
- **CRC Service**: New `CRC` service with 363-line test suite for checksum operations
|
|
1658
|
+
- **Stream Transforms**: New transform modules — `checksumTransform`, `eciesEncryptTransform`, `eciesDecryptTransform`, `xorTransform`, `xorMultipleTransform`
|
|
1659
|
+
- **TypedConfiguration**: New `typed-configuration.ts` with 105-line test suite
|
|
1660
|
+
- `Uint8ArrayIdProvider` fix, `Member` model updates
|
|
1661
|
+
- Multi-recipient processor improvements
|
|
1624
1662
|
|
|
1625
1663
|
**Migration Guide:**
|
|
1626
1664
|
```typescript
|
|
1627
1665
|
// BEFORE (v4.10.x and earlier)
|
|
1628
|
-
import { AESGCMService } from '@digitaldefiance/ecies-lib';
|
|
1629
|
-
|
|
1630
1666
|
const { encrypted, iv, tag } = await AESGCMService.encrypt(data, key, true);
|
|
1631
|
-
const combined = AESGCMService.combineEncryptedDataAndTag(encrypted, tag);
|
|
1632
1667
|
|
|
1633
|
-
// AFTER (v4.
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
const aesGcm = new AESGCMService(); // Create instance
|
|
1668
|
+
// AFTER (v4.12.0+)
|
|
1669
|
+
const aesGcm = new AESGCMService();
|
|
1637
1670
|
const { encrypted, iv, tag } = await aesGcm.encrypt(data, key, true);
|
|
1638
|
-
const combined = aesGcm.combineEncryptedDataAndTag(encrypted, tag);
|
|
1639
1671
|
|
|
1640
1672
|
// NEW: JSON encryption
|
|
1641
|
-
const userData = { name: 'Alice', email: 'alice@example.com' };
|
|
1642
1673
|
const encrypted = await aesGcm.encryptJson(userData, key);
|
|
1643
1674
|
const decrypted = await aesGcm.decryptJson<typeof userData>(encrypted, key);
|
|
1644
1675
|
```
|
|
1645
1676
|
|
|
1646
|
-
|
|
1647
|
-
- Added 17 comprehensive tests for JSON encryption methods
|
|
1648
|
-
- Added 3 e2e tests for real-world JSON scenarios
|
|
1649
|
-
- All 1,200+ existing tests updated and passing
|
|
1677
|
+
### Versions 4.11.x (v4.11.0 – v4.11.3)
|
|
1650
1678
|
|
|
1651
|
-
|
|
1679
|
+
**Guid overhaul, versioned GUID types**
|
|
1652
1680
|
|
|
1653
|
-
|
|
1654
|
-
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
- **Enhanced Developer Experience**:
|
|
1660
|
-
- Full IntelliSense support for native ID types (`ObjectId`, `Guid`, `string`, etc.)
|
|
1661
|
-
- Compile-time type checking prevents runtime type errors
|
|
1662
|
-
- Multiple migration paths to choose from based on use case
|
|
1663
|
-
- **Zero Breaking Changes**: All existing code continues to work unchanged
|
|
1664
|
-
- Original `Constants.idProvider` pattern still supported
|
|
1665
|
-
- Enhanced providers include all original methods plus typed alternatives
|
|
1666
|
-
- Backward compatibility maintained for all existing APIs
|
|
1667
|
-
|
|
1668
|
-
**New APIs:**
|
|
1669
|
-
- `getEnhancedIdProvider<T>(key?)`: Enhanced provider with typed convenience methods
|
|
1670
|
-
- `getTypedIdProvider<T>(key?)`: Simple typed provider
|
|
1671
|
-
- `createObjectIdConfiguration(overrides?)`: ObjectId-typed configuration
|
|
1672
|
-
- `createGuidV4Configuration(overrides?)`: GuidV4-typed configuration
|
|
1673
|
-
- `createUint8ArrayConfiguration(overrides?)`: Uint8Array-typed configuration
|
|
1674
|
-
- `createUuidConfiguration(overrides?)`: UUID string-typed configuration
|
|
1675
|
-
- `TypedIdProviderWrapper<T>`: Enhanced wrapper with typed methods
|
|
1676
|
-
|
|
1677
|
-
**Migration Examples:**
|
|
1678
|
-
```typescript
|
|
1679
|
-
// BEFORE: Weak typing
|
|
1680
|
-
const Constants = getRuntimeConfiguration();
|
|
1681
|
-
const id = Constants.idProvider.generate(); // Uint8Array, no strong typing
|
|
1681
|
+
- Major `GuidUint8Array` rewrite (683 lines changed) — improved parsing, validation, and version tracking
|
|
1682
|
+
- New `guid-versions.ts` types module for compile-time GUID version tracking
|
|
1683
|
+
- `GuidV4Provider` refactored to align with new GUID architecture
|
|
1684
|
+
- `ECIESService` updates for new GUID integration
|
|
1685
|
+
- `TypedConfiguration` and `PlatformID` interface updates
|
|
1686
|
+
- Showcase and documentation updates across patch versions
|
|
1682
1687
|
|
|
1683
|
-
|
|
1684
|
-
const enhancedProvider = getEnhancedIdProvider<ObjectId>();
|
|
1685
|
-
const objectId = enhancedProvider.generateTyped(); // ObjectId - strongly typed!
|
|
1688
|
+
### Version 4.10.7
|
|
1686
1689
|
|
|
1687
|
-
|
|
1688
|
-
const typedId = typedProvider.fromBytes(bytes); // ObjectId, not unknown!
|
|
1690
|
+
**Strong typing for ID providers**
|
|
1689
1691
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
-
|
|
1696
|
-
- Updated README with strong typing examples
|
|
1697
|
-
- Added usage examples and real-world migration patterns
|
|
1698
|
-
|
|
1699
|
-
**Testing:**
|
|
1700
|
-
- 14 new tests covering all strong typing scenarios
|
|
1701
|
-
- Property-based tests for type safety validation
|
|
1702
|
-
- Migration pattern tests for backward compatibility
|
|
1692
|
+
- `getEnhancedIdProvider<T>()`: Drop-in replacement for `Constants.idProvider` with typed methods
|
|
1693
|
+
- `getTypedIdProvider<T>()`: Simple typed provider for minimal API surface
|
|
1694
|
+
- `createObjectIdConfiguration()`, `createGuidV4Configuration()`, `createUint8ArrayConfiguration()`, `createUuidConfiguration()`: Typed configuration factories
|
|
1695
|
+
- `TypedIdProviderWrapper<T>`: Enhanced wrapper with typed convenience methods
|
|
1696
|
+
- Full IntelliSense support, compile-time type checking, zero breaking changes
|
|
1697
|
+
- 14 new tests, property-based tests for type safety, migration guide
|
|
1703
1698
|
|
|
1704
1699
|
### v4.10.6 - Voting System & PlatformID Integration
|
|
1705
1700
|
|
|
@@ -1864,6 +1859,104 @@ console.log(member.id.length); // 16 (correct - uses configured GuidV4Provider)
|
|
|
1864
1859
|
- The `ECIESService.config` getter still returns `IECIESConfig` for backward compatibility
|
|
1865
1860
|
- `Member.fromJson()` warns but doesn't fail on ID length mismatch (for compatibility with existing serialized data)
|
|
1866
1861
|
|
|
1862
|
+
### Versions v4.7.1 - v4.7.11 - idProvider Configuration & Testing
|
|
1863
|
+
|
|
1864
|
+
**v4.7.10, v4.7.11 - idProvider Test Coverage**
|
|
1865
|
+
|
|
1866
|
+
- Property-based tests for `MemberBuilder` with various `idProvider` configurations
|
|
1867
|
+
- Integration tests for documented usage patterns and `idProvider` workflows (578+ lines)
|
|
1868
|
+
- `ECIESService` constructor property-based tests (404+ lines)
|
|
1869
|
+
- `Member` idProvider unit and property-based tests (486+ lines)
|
|
1870
|
+
|
|
1871
|
+
**v4.7.5, v4.7.6 - idProvider Fixes & Showcase Updates**
|
|
1872
|
+
|
|
1873
|
+
- `ECIESService` now stores full `IConstants` configuration (not just `IECIESConfig`)
|
|
1874
|
+
- `Member.newMember()` uses `eciesService.constants.idProvider.generate()` for ID generation
|
|
1875
|
+
- `Member.toJson()` / `Member.fromJson()` use the service's configured `idProvider`
|
|
1876
|
+
- Showcase voting demo improvements (RankedChoice demo enhancements)
|
|
1877
|
+
|
|
1878
|
+
**v4.7.1 - Voting Bulletin Board & Event Logger Refinements**
|
|
1879
|
+
|
|
1880
|
+
- Bulletin board and event logger type signature improvements
|
|
1881
|
+
- Poll type refinements
|
|
1882
|
+
- RCV demo fixes
|
|
1883
|
+
|
|
1884
|
+
### v4.7.0 - Full Voting System (Major Release)
|
|
1885
|
+
|
|
1886
|
+
**Massive Feature: Complete Encrypted Voting System** (19,533 insertions)
|
|
1887
|
+
|
|
1888
|
+
- **Poll System**: `Poll`, `PollCore`, `PollFactory` — full lifecycle management for encrypted polls with multiple voting methods (Plurality, Approval, RCV, STV, Borda, Score, STAR, Quadratic, Weighted, Supermajority, TwoRound, Consensus, ConsentBased, YesNo, YesNoAbstain)
|
|
1889
|
+
- **Audit Trail**: `AuditLog` with cryptographic verification of vote integrity
|
|
1890
|
+
- **Bulletin Board**: Public append-only ledger for vote transparency
|
|
1891
|
+
- **Vote Encoder**: Ballot encoding/decoding for encrypted transmission
|
|
1892
|
+
- **Event Logger**: Comprehensive voting event tracking and logging
|
|
1893
|
+
- **Tallier**: Multi-method vote tallying engine (561 lines)
|
|
1894
|
+
- **Security Validator**: Vote validation and anti-fraud checks
|
|
1895
|
+
- **Poll Factory**: Configurable poll creation with method-specific parameters
|
|
1896
|
+
- **Government Requirements**: Detailed compliance documentation (824 lines)
|
|
1897
|
+
- **Phase 2 Design Docs**: Architecture diagrams, implementation plans, interface references
|
|
1898
|
+
- **Showcase Voting Demos**: Interactive demos for all 16 voting methods (Approval, Borda, Consensus, ConsentBased, Plurality, Quadratic, RankedChoice, STAR, STV, Score, Supermajority, TwoRound, Weighted, YesNo, YesNoAbstain)
|
|
1899
|
+
- **Voting Poll Interfaces**: 517-line interface definition for poll configuration and state
|
|
1900
|
+
|
|
1901
|
+
### v4.6.0 - Voting Interfaces & Isolated Encryption Modules
|
|
1902
|
+
|
|
1903
|
+
**New Features:**
|
|
1904
|
+
|
|
1905
|
+
- **Voting Interfaces**: `IVotingService` interface (211 lines) defining the voting service contract
|
|
1906
|
+
- **Voting Constants**: `IVotingConstants` interface for voting-specific configuration
|
|
1907
|
+
- **Voting Error Types**: `VotingErrorType` enum and `VotingError` class for structured error handling
|
|
1908
|
+
- **Isolated Encryption Modules**: `IsolatedPrivate` (178 lines) and `IsolatedPublic` (434 lines) — standalone encryption/decryption without full member context
|
|
1909
|
+
- **Isolated Key Interfaces**: `IIsolatedKeys` interface (109 lines) for key management
|
|
1910
|
+
- **Platform Buffer Interface**: `IPlatformBuffer` for cross-platform buffer abstraction
|
|
1911
|
+
- **ECIES Library Interface**: `IECIESLibrary` interface (347 lines) defining the full library contract
|
|
1912
|
+
- Comprehensive tests for isolated modules (688 lines)
|
|
1913
|
+
- Expanded voting service tests (349+ lines)
|
|
1914
|
+
|
|
1915
|
+
### Versions v4.6.1 - v4.6.3 - Isolated Module Refinements
|
|
1916
|
+
|
|
1917
|
+
- Extracted `IIsolatedKeys` interface to dedicated file
|
|
1918
|
+
- Refined `IVotingService` interface (reduced from 211 to focused contract)
|
|
1919
|
+
- Improved `IsolatedPublic` key handling
|
|
1920
|
+
- Minor member interface adjustments
|
|
1921
|
+
|
|
1922
|
+
### Versions v4.5.1 - v4.5.18 - Showcase Application & Voting Service Evolution
|
|
1923
|
+
|
|
1924
|
+
**v4.5.11 - v4.5.18 - Showcase App Development**
|
|
1925
|
+
|
|
1926
|
+
- **Showcase Application**: Full React showcase with Hero, About, Components, Features, and Demo pages
|
|
1927
|
+
- **GitHub Pages Deployment**: CI workflow for automated showcase deployment
|
|
1928
|
+
- **Voting Demo Integration**: Interactive voting demos added to showcase
|
|
1929
|
+
- **Vite Configuration**: Showcase build configuration with library aliasing
|
|
1930
|
+
- Buffer-compat and crypto-polyfill improvements for browser environments
|
|
1931
|
+
|
|
1932
|
+
**v4.5.1 - v4.5.9 - Voting Service Refinements**
|
|
1933
|
+
|
|
1934
|
+
- Expanded `VotingService` implementation (355+ line rewrite)
|
|
1935
|
+
- Removed standalone `voting-utils.ts` (192 lines) — functionality merged into `VotingService`
|
|
1936
|
+
- Multi-recipient processor improvements
|
|
1937
|
+
- Signature service updates
|
|
1938
|
+
- Type refinements for voting interfaces
|
|
1939
|
+
|
|
1940
|
+
### v4.5.0 - Initial Voting Service
|
|
1941
|
+
|
|
1942
|
+
**New Feature: Member Voting & VotingService**
|
|
1943
|
+
|
|
1944
|
+
- **VotingService**: Initial implementation (706 lines) for encrypted member voting
|
|
1945
|
+
- **Voting Utilities**: `voting-utils.ts` (192 lines) with key derivation and ballot helpers
|
|
1946
|
+
- **Member Voting Keys**: Extended `IMember` interface with voting key support
|
|
1947
|
+
- **Member Extensions**: Voting key generation and management on `Member` class (49 lines)
|
|
1948
|
+
- Comprehensive voting service tests (814 lines) and member voting tests (863 lines)
|
|
1949
|
+
|
|
1950
|
+
### Versions v4.4.8 - v4.4.25 - Showcase Foundations & Code Quality
|
|
1951
|
+
|
|
1952
|
+
- **Error Class Refactoring**: Modernized all error classes (`DisposedError`, `IdProviderError`, `InvalidEmailError`, `LengthError`, `MemberError`, `Pbkdf2Error`, `SecureStorageError`, `SimpleEciesError`)
|
|
1953
|
+
- **i18n Setup Refactoring**: Simplified `i18n-setup.ts` initialization
|
|
1954
|
+
- **ESLint Configuration**: Updated linting rules
|
|
1955
|
+
- **Jest Configuration**: Improved test setup
|
|
1956
|
+
- **Index Exports**: Reorganized barrel exports
|
|
1957
|
+
- **ID Provider Interface**: Removed standalone `IIdProvider` (moved to shared lib)
|
|
1958
|
+
- Dependency updates and version bumps
|
|
1959
|
+
|
|
1867
1960
|
### v4.4.2
|
|
1868
1961
|
|
|
1869
1962
|
- Update test-utils
|
package/package.json
CHANGED
|
@@ -38,6 +38,10 @@ export declare enum IdProviderErrorType {
|
|
|
38
38
|
/**
|
|
39
39
|
* Invalid UUID format.
|
|
40
40
|
*/
|
|
41
|
-
InvalidUuidFormat = "InvalidUuidFormat"
|
|
41
|
+
InvalidUuidFormat = "InvalidUuidFormat",
|
|
42
|
+
/**
|
|
43
|
+
* Invalid print fomrat ('hex', 'base64', 'int')
|
|
44
|
+
*/
|
|
45
|
+
InvalidFormat = "InvalidFormat"
|
|
42
46
|
}
|
|
43
47
|
//# sourceMappingURL=id-provider-error-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-provider-error-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/id-provider-error-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,qBAAqB,0BAA0B;IAE/C;;OAEG;IACH,0BAA0B,+BAA+B;IAEzD;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,iBAAiB,sBAAsB;
|
|
1
|
+
{"version":3,"file":"id-provider-error-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/id-provider-error-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,qBAAqB,0BAA0B;IAE/C;;OAEG;IACH,0BAA0B,+BAA+B;IAEzD;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,aAAa,kBAAkB;CAChC"}
|
|
@@ -43,5 +43,9 @@ var IdProviderErrorType;
|
|
|
43
43
|
* Invalid UUID format.
|
|
44
44
|
*/
|
|
45
45
|
IdProviderErrorType["InvalidUuidFormat"] = "InvalidUuidFormat";
|
|
46
|
+
/**
|
|
47
|
+
* Invalid print fomrat ('hex', 'base64', 'int')
|
|
48
|
+
*/
|
|
49
|
+
IdProviderErrorType["InvalidFormat"] = "InvalidFormat";
|
|
46
50
|
})(IdProviderErrorType || (exports.IdProviderErrorType = IdProviderErrorType = {}));
|
|
47
51
|
//# sourceMappingURL=id-provider-error-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-provider-error-type.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/id-provider-error-type.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"id-provider-error-type.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/id-provider-error-type.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,mBAkDX;AAlDD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,sDAA+B,CAAA;IAE/B;;OAEG;IACH,8DAAuC,CAAA;IAEvC;;OAEG;IACH,kEAA2C,CAAA;IAE3C;;OAEG;IACH,8DAAuC,CAAA;IAEvC;;OAEG;IACH,sEAA+C,CAAA;IAE/C;;OAEG;IACH,gFAAyD,CAAA;IAEzD;;OAEG;IACH,kDAA2B,CAAA;IAE3B;;OAEG;IACH,8DAAuC,CAAA;IAEvC;;OAEG;IACH,8DAAuC,CAAA;IAEvC;;OAEG;IACH,sDAA+B,CAAA;AACjC,CAAC,EAlDW,mBAAmB,mCAAnB,mBAAmB,QAkD9B"}
|
|
@@ -63,6 +63,14 @@ export interface IIdProviderBase {
|
|
|
63
63
|
* @returns The parsed ID in the provider's native format, or undefined if invalid
|
|
64
64
|
*/
|
|
65
65
|
parseSafe(str: string): unknown | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Converts the ID to a string in the specified format.
|
|
68
|
+
* @param id The ID to convert to a string
|
|
69
|
+
* @param format The format to use for the string representation
|
|
70
|
+
* @throws Error if the format is not supported
|
|
71
|
+
* @returns A string representation of the ID in the specified format
|
|
72
|
+
*/
|
|
73
|
+
toString(id: unknown, format: 'hex' | 'base64' | 'int'): string;
|
|
66
74
|
}
|
|
67
75
|
/**
|
|
68
76
|
* Full interface for ID providers that supply recipient identifiers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-provider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/interfaces/id-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,IAAI,UAAU,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC;IAElC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC;IAElC;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAErC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,UAAU,CAAC;IAEjC;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;IAEtC;;;;;OAKG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"id-provider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/interfaces/id-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,IAAI,UAAU,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC;IAElC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC;IAElC;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAErC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,UAAU,CAAC;IAEjC;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;IAEtC;;;;;OAKG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAE5C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;CACjE;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,eAAe;IACrD;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAEhB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;IAE7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,CAAC,CAAC;IAEhC;;;;;OAKG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;CACvC"}
|
|
@@ -49,5 +49,6 @@ export declare abstract class BaseIdProvider<T> implements IIdProvider<T> {
|
|
|
49
49
|
*/
|
|
50
50
|
protected constantTimeEquals(a: Uint8Array, b: Uint8Array): boolean;
|
|
51
51
|
abstract parseSafe(str: string): T | undefined;
|
|
52
|
+
abstract toString(id: T, format: 'hex' | 'base64' | 'int'): string;
|
|
52
53
|
}
|
|
53
54
|
//# sourceMappingURL=base-id-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-id-provider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/base-id-provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;GAKG;AACH,8BAAsB,cAAc,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,QAAQ,IAAI,UAAU;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IAC1C,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAE7C;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU;IAEnC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO;IAEpC;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM;IAIzB;;;OAGG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC;IAI5B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAW/D;;;OAGG;IACH,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO;IAWnE,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"base-id-provider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/base-id-provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;GAKG;AACH,8BAAsB,cAAc,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,QAAQ,IAAI,UAAU;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IAC1C,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAE7C;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU;IAEnC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO;IAEpC;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM;IAIzB;;;OAGG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC;IAI5B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAW/D;;;OAGG;IACH,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO;IAWnE,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAE9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM;CACnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-id-provider.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/base-id-provider.ts"],"names":[],"mappings":";;;AAAA,mFAA6E;AAC7E,uDAAwD;AAGxD;;;;;GAKG;AACH,MAAsB,cAAc;IA8BlC;;;OAGG;IACH,UAAU,CAAC,EAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,GAAW;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,EAAc,EAAE,OAAe;QACtD,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,MAAM,IAAI,6BAAe,CACvB,4CAAmB,CAAC,aAAa,EACjC,SAAS,EACT,SAAS,EACT,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAC1D,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,kBAAkB,CAAC,CAAa,EAAE,CAAa;QACvD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,KAAK,CAAC,CAAC;IACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"base-id-provider.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/base-id-provider.ts"],"names":[],"mappings":";;;AAAA,mFAA6E;AAC7E,uDAAwD;AAGxD;;;;;GAKG;AACH,MAAsB,cAAc;IA8BlC;;;OAGG;IACH,UAAU,CAAC,EAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,GAAW;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,EAAc,EAAE,OAAe;QACtD,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,MAAM,IAAI,6BAAe,CACvB,4CAAmB,CAAC,aAAa,EACjC,SAAS,EACT,SAAS,EACT,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAC1D,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,kBAAkB,CAAC,CAAa,EAAE,CAAa;QACvD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,KAAK,CAAC,CAAC;IACpB,CAAC;CAKF;AA9ED,wCA8EC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-to-GUID conversion utilities.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from GuidUint8Array to break the circular dependency between
|
|
5
|
+
* guid.ts and id-providers. These functions import both modules without
|
|
6
|
+
* creating a cycle since nothing imports back into this file from either side.
|
|
7
|
+
*/
|
|
8
|
+
import { BaseIdProvider } from './base-id-provider';
|
|
9
|
+
import { VersionedGuidUint8Array } from './guid';
|
|
10
|
+
/**
|
|
11
|
+
* Convert a provider's native ID to a GuidUint8Array.
|
|
12
|
+
*
|
|
13
|
+
* For 16-byte providers (GuidV4Provider, UuidProvider) the bytes are
|
|
14
|
+
* reinterpreted directly as a GUID — they already are one.
|
|
15
|
+
*
|
|
16
|
+
* For non-16-byte providers (ObjectIdProvider, CustomIdProvider,
|
|
17
|
+
* Uint8ArrayIdProvider) a deterministic UUID v5 is derived using a
|
|
18
|
+
* provider-specific namespace, so the same input always yields the same
|
|
19
|
+
* GUID and different providers never collide.
|
|
20
|
+
*/
|
|
21
|
+
export declare function fromProviderId<T>(id: T, provider: BaseIdProvider<T>): VersionedGuidUint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* Convert raw ID bytes (from any provider) to a GuidUint8Array.
|
|
24
|
+
*
|
|
25
|
+
* Same strategy as {@link fromProviderId} but starts from the Uint8Array
|
|
26
|
+
* byte representation rather than the provider's native type.
|
|
27
|
+
*/
|
|
28
|
+
export declare function fromProviderIdBytes<T>(idBytes: Uint8Array, provider: BaseIdProvider<T>): VersionedGuidUint8Array;
|
|
29
|
+
//# sourceMappingURL=guid-provider-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guid-provider-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/guid-provider-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAkB,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAiBjE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,EAAE,EAAE,CAAC,EACL,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAC1B,uBAAuB,CAGzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAC1B,uBAAuB,CA0BzB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Provider-to-GUID conversion utilities.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from GuidUint8Array to break the circular dependency between
|
|
6
|
+
* guid.ts and id-providers. These functions import both modules without
|
|
7
|
+
* creating a cycle since nothing imports back into this file from either side.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.fromProviderId = fromProviderId;
|
|
11
|
+
exports.fromProviderIdBytes = fromProviderIdBytes;
|
|
12
|
+
const guid_error_type_1 = require("../enumerations/guid-error-type");
|
|
13
|
+
const guid_1 = require("../errors/guid");
|
|
14
|
+
const guid_2 = require("./guid");
|
|
15
|
+
const id_providers_1 = require("./id-providers");
|
|
16
|
+
// Well-known v5 namespace UUIDs for deterministic derivation.
|
|
17
|
+
// These are arbitrary but fixed UUIDs that scope the v5 hash per provider,
|
|
18
|
+
// ensuring that the same raw bytes from different providers produce
|
|
19
|
+
// different GUIDs.
|
|
20
|
+
const NS_OBJECTID = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
|
|
21
|
+
const NS_CUSTOM = '6ba7b815-9dad-11d1-80b4-00c04fd430c8';
|
|
22
|
+
const NS_UINT8ARRAY = '6ba7b816-9dad-11d1-80b4-00c04fd430c8';
|
|
23
|
+
/**
|
|
24
|
+
* Convert a provider's native ID to a GuidUint8Array.
|
|
25
|
+
*
|
|
26
|
+
* For 16-byte providers (GuidV4Provider, UuidProvider) the bytes are
|
|
27
|
+
* reinterpreted directly as a GUID — they already are one.
|
|
28
|
+
*
|
|
29
|
+
* For non-16-byte providers (ObjectIdProvider, CustomIdProvider,
|
|
30
|
+
* Uint8ArrayIdProvider) a deterministic UUID v5 is derived using a
|
|
31
|
+
* provider-specific namespace, so the same input always yields the same
|
|
32
|
+
* GUID and different providers never collide.
|
|
33
|
+
*/
|
|
34
|
+
function fromProviderId(id, provider) {
|
|
35
|
+
const bytes = provider.toBytes(id);
|
|
36
|
+
return fromProviderIdBytes(bytes, provider);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert raw ID bytes (from any provider) to a GuidUint8Array.
|
|
40
|
+
*
|
|
41
|
+
* Same strategy as {@link fromProviderId} but starts from the Uint8Array
|
|
42
|
+
* byte representation rather than the provider's native type.
|
|
43
|
+
*/
|
|
44
|
+
function fromProviderIdBytes(idBytes, provider) {
|
|
45
|
+
if (idBytes.length !== provider.byteLength) {
|
|
46
|
+
throw new guid_1.GuidError(guid_error_type_1.GuidErrorType.InvalidGuid);
|
|
47
|
+
}
|
|
48
|
+
// 16-byte providers: the bytes already represent a valid GUID
|
|
49
|
+
if (provider instanceof id_providers_1.GuidV4Provider || provider instanceof id_providers_1.UuidProvider) {
|
|
50
|
+
return guid_2.GuidUint8Array.fromPlatformBuffer(idBytes);
|
|
51
|
+
}
|
|
52
|
+
// Non-16-byte providers: derive a deterministic v5 GUID
|
|
53
|
+
const serialized = provider.serialize(idBytes);
|
|
54
|
+
let namespace;
|
|
55
|
+
if (provider instanceof id_providers_1.ObjectIdProvider) {
|
|
56
|
+
namespace = NS_OBJECTID;
|
|
57
|
+
}
|
|
58
|
+
else if (provider instanceof id_providers_1.CustomIdProvider) {
|
|
59
|
+
namespace = NS_CUSTOM;
|
|
60
|
+
}
|
|
61
|
+
else if (provider instanceof id_providers_1.Uint8ArrayIdProvider) {
|
|
62
|
+
namespace = NS_UINT8ARRAY;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// Fallback for unknown providers
|
|
66
|
+
namespace = NS_CUSTOM;
|
|
67
|
+
}
|
|
68
|
+
return guid_2.GuidUint8Array.v5(serialized, namespace);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=guid-provider-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guid-provider-utils.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/lib/guid-provider-utils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAiCH,wCAMC;AAQD,kDA6BC;AA1ED,qEAAgE;AAChE,yCAA2C;AAE3C,iCAAiE;AACjE,iDAMwB;AAExB,8DAA8D;AAC9D,2EAA2E;AAC3E,oEAAoE;AACpE,mBAAmB;AACnB,MAAM,WAAW,GAAG,sCAAsC,CAAC;AAC3D,MAAM,SAAS,GAAG,sCAAsC,CAAC;AACzD,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,SAAgB,cAAc,CAC5B,EAAK,EACL,QAA2B;IAE3B,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACnC,OAAO,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,OAAmB,EACnB,QAA2B;IAE3B,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC3C,MAAM,IAAI,gBAAS,CAAC,+BAAa,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED,8DAA8D;IAC9D,IAAI,QAAQ,YAAY,6BAAc,IAAI,QAAQ,YAAY,2BAAY,EAAE,CAAC;QAC3E,OAAO,qBAAc,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,wDAAwD;IACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/C,IAAI,SAAiB,CAAC;IAEtB,IAAI,QAAQ,YAAY,+BAAgB,EAAE,CAAC;QACzC,SAAS,GAAG,WAAW,CAAC;IAC1B,CAAC;SAAM,IAAI,QAAQ,YAAY,+BAAgB,EAAE,CAAC;QAChD,SAAS,GAAG,SAAS,CAAC;IACxB,CAAC;SAAM,IAAI,QAAQ,YAAY,mCAAoB,EAAE,CAAC;QACpD,SAAS,GAAG,aAAa,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,iCAAiC;QACjC,SAAS,GAAG,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,qBAAc,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
|