menu

CryptoDigestBinding

import { CryptoDigestBinding } from "destack:crypto/binding";

Digest binding family.

language/library/src/crypto/binding/digest.ds:11:64
1export interface CryptoDigestBinding {2    computeDigest(algorithm: CryptoDigestAlgorithm, payload: &'a readonly [uint8]): Result<uint8[], HostError>;3    openDigest(algorithm: CryptoDigestAlgorithm): Result<CryptoDigestHandle, HostError>;4    updateDigest(digest: CryptoDigestHandle, payload: &'a readonly [uint8]): Result<void, HostError>;5    finishDigest(digest: CryptoDigestHandle): Result<uint8[], HostError>;6    closeDigest(digest: CryptoDigestHandle): Result<void, HostError>;7}

Members

computeDigest(algorithm: CryptoDigestAlgorithm, payload: &'a readonly [uint8]): Result<uint8[], HostError>

Compute one digest in one shot.

openDigest(algorithm: CryptoDigestAlgorithm): Result<CryptoDigestHandle, HostError>

Open one streaming digest context.

updateDigest(digest: CryptoDigestHandle, payload: &'a readonly [uint8]): Result<void, HostError>

Update one streaming digest context.

finishDigest(digest: CryptoDigestHandle): Result<uint8[], HostError>

Finalize one streaming digest context and return one digest output.

closeDigest(digest: CryptoDigestHandle): Result<void, HostError>

Close one streaming digest context.