MCPcopy Create free account
hub / github.com/ConsortiumAI/Consortium / decrypt

Function decrypt

packages/consortium-web/src/lib/encryption.ts:200–209  ·  view source on GitHub ↗
(
  key: Uint8Array,
  variant: 'legacy' | 'dataKey',
  data: Uint8Array,
)

Source from the content-addressed store, hash-verified

198}
199
200export async function decrypt(
201 key: Uint8Array,
202 variant: 'legacy' | 'dataKey',
203 data: Uint8Array,
204): Promise<unknown | null> {
205 if (variant === 'legacy') {
206 return decryptLegacy(data, key);
207 }
208 return decryptWithDataKey(data, key);
209}

Callers 3

decryptMessageUpdateFunction · 0.90
fetchSessionsFunction · 0.90
fetchMessagesFunction · 0.90

Calls 2

decryptLegacyFunction · 0.70
decryptWithDataKeyFunction · 0.70

Tested by

no test coverage detected