This task implements the core orchestration logic for the "unseal" event. When the OpenKCM service initializes, it must query the database to "peek" at available encrypted shards and select the minimum subset ($M$) required to reconstruct the MasterKey.
The aggregator acts as a traffic controller: it fetches metadata from the database, selects the healthiest or most accessible shards, parallelizes decryption requests to various KMS/HSM providers, and validates the integrity of the resulting plaintext shards before handed them to the GF(256) Math Engine.
Goals
- Implement a "Best-Available" selection strategy to retrieve exactly $M$ shards.
- Orchestrate parallel decryption calls to diverse providers (AWS, GCP, Vault, HSM).
- Implement a "Retry-with-Alternative" logic: if a specific provider is down, fetch a different shard from the database to meet the threshold.
- Aggregate decrypted bytes and verify shard indices ($x$ values) are unique.
Acceptance Criteria
Implementation Details
The flow follows a Gather -> Decrypt -> Verify -> Reduce pattern. To minimize the attack surface, the aggregator should never log the plaintext content of any shard, even in "Debug" mode.
This task implements the core orchestration logic for the "unseal" event. When the OpenKCM service initializes, it must query the database to "peek" at available encrypted shards and select the minimum subset ($M$ ) required to reconstruct the MasterKey.
The aggregator acts as a traffic controller: it fetches metadata from the database, selects the healthiest or most accessible shards, parallelizes decryption requests to various KMS/HSM providers, and validates the integrity of the resulting plaintext shards before handed them to the GF(256) Math Engine.
Goals
Acceptance Criteria
context.Contexttimeout for the entire aggregation phase.MasterKeyHoldersecure buffers.0x00) immediately after the Math Engine produces the final key.Implementation Details
The flow follows a Gather -> Decrypt -> Verify -> Reduce pattern. To minimize the attack surface, the aggregator should never log the plaintext content of any shard, even in "Debug" mode.