menu
CryptoCipherBinding
import { CryptoCipherBinding } from "destack:crypto/binding";
Cipher binding family.
1export interface CryptoCipherBinding {2 encryptCipher(key: CryptoKeyHandle, parameters: &'b readonly CryptoCipherParameters<'a>, payload: &'c readonly [uint8]): Result<CryptoCipherOutput, HostError>;3 decryptCipher(key: CryptoKeyHandle, parameters: &'b readonly CryptoCipherParameters<'a>, payload: &'c readonly [uint8]): Result<uint8[], HostError>;4 openCipher(key: CryptoKeyHandle, direction: CryptoCipherDirection, parameters: &'b readonly CryptoCipherParameters<'a>): Result<CryptoCipherHandle, HostError>;5 updateCipherAdditionalData(cipher: CryptoCipherHandle, additionalData: &'a readonly [uint8]): Result<void, HostError>;6 updateCipher(cipher: CryptoCipherHandle, payload: &'a readonly [uint8]): Result<uint8[], HostError>;7 finishCipher(cipher: CryptoCipherHandle, finalPayload: &'a readonly [uint8]): Result<CryptoCipherOutput, HostError>;8 closeCipher(cipher: CryptoCipherHandle): Result<void, HostError>;9}Members
encryptCipher(key: CryptoKeyHandle, parameters: &'b readonly CryptoCipherParameters<'a>, payload: &'c readonly [uint8]): Result<CryptoCipherOutput, HostError>Encrypt one payload in one shot.
decryptCipher(key: CryptoKeyHandle, parameters: &'b readonly CryptoCipherParameters<'a>, payload: &'c readonly [uint8]): Result<uint8[], HostError>Decrypt one payload in one shot.
openCipher(key: CryptoKeyHandle, direction: CryptoCipherDirection, parameters: &'b readonly CryptoCipherParameters<'a>): Result<CryptoCipherHandle, HostError>Open one streaming cipher context.
updateCipherAdditionalData(cipher: CryptoCipherHandle, additionalData: &'a readonly [uint8]): Result<void, HostError>Add authenticated data to one streaming cipher context.
updateCipher(cipher: CryptoCipherHandle, payload: &'a readonly [uint8]): Result<uint8[], HostError>Update one streaming cipher context with one payload chunk.
finishCipher(cipher: CryptoCipherHandle, finalPayload: &'a readonly [uint8]): Result<CryptoCipherOutput, HostError>Finalize one streaming cipher context.
closeCipher(cipher: CryptoCipherHandle): Result<void, HostError>Close one streaming cipher context.