INNER CODE UNIT · TypeScript

newRevision

backbone-hq/minibone · src/index.ts:117

    const newRevision = this.revision + 1

    const encodedBundle: Uint8Array = encodeCbor(bundle)
    const encodedAssociatedData: Uint8Array = encodeCanonical([newRevision])
    const [bundleIv, bundleCiphertext] = await encryptData(encodedBundle, bundleKey, encodedAssociatedData)

    const v0Envelope: EnvelopeV0 = {
      revision: newRevision,
      iv: bundleIv,
      ciphertext: bundleCiphertext
    }

    const envelope: Envelope = {
      v0: v0Envelope
    }

    return encodeCbor(envelope)
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…