DustBackupEncryptor

AES-256-GCM encryption for the dust cloud-backup bundle.

Same construction as AppStateBackupEncryptor (version || IV(12) || ciphertext+GCMtag) but size-agnostic: the dust state is ~500 KB, far past that encryptor's 2 KB metadata cap, and the bundle (DustCloudBundleCodec) carries its own internal lengths — so this encryptor just seals/opens an arbitrary byte payload with no length prefix or cap. Kept separate so the load-bearing passkey-backup encryptor is untouched.

Throws BackupDecryptionException (shared with AppStateBackupEncryptor) on a malformed blob or AEAD verification failure.

Functions

Link copied to clipboard
fun decrypt(aesKey: ByteArray, blob: ByteArray): ByteArray

Opens a blob produced by encrypt.

Link copied to clipboard
fun encrypt(aesKey: ByteArray, plaintext: ByteArray): ByteArray

Seals plaintext (any size) under aesKey.