at_chops_ffi library
FFI surface for at_chops — includes AtPqc and OpenSSL-backed algorithms; not web/wasm compatible.
Classes
- AbstractKey
- Represents abstract format all keys should be in.
- AbstractKeyPair
- Represents abstract format of a keyPair
- AESEncryptionAlgo
- A class that provides AES encryption and decryption for Uint8List, implementing the SymmetricEncryptionAlgorithm interface.
- AesGcm256EncryptionAlgo
-
AES-256-GCM authenticated encryption (AEAD), backed by pure-Dart
(
package:cryptography). - AesGcm256FfiAlgo
-
AES-256-GCM authenticated encryption (AEAD), backed by OpenSSL 3 via
Dart FFI (
EVP_CIPHER_CTX/EVP_aes_256_gcm). - AESKey
- Represents an AES key for symmetric encryption.
- ArgonHashParams
- ASymmetricEncryptionAlgorithm
-
Interface for asymmetric encryption algorithms. Check
DefaultEncryptionAlgofor sample implementation. - AsymmetricKeyPair
- Represents an AsymmetricKeyPair format
- AtChops
- Base class for all Cryptographic and Hashing Operations. Callers have to either implement specific encryption, signing or hashing algorithms. Otherwise default implementation of specific algorithms will be used.
- AtChopsImpl
- AtChopsKeys
- AtChopsUtil
- AtEncrypted
- A class that represents encrypted content, along with metadata such as initialization vector (IV) and the hashing algorithm used.
-
AtEncryptionAlgorithm<
T, V> -
Interface for encrypting and decrypting data. Check
DefaultEncryptionAlgofor sample implementation. - AtEncryptionKeyPair
- AtEncryptionMetaData
- Class which represents metadata for encryption/decryption.
- AtEncryptionResult
-
AtHashingAlgorithm<
K, V> - Interface for hashing data. Refer DefaultHash for sample implementation.
- AtKemAlgorithm
- Interface for a Key Encapsulation Mechanism (KEM) such as ML-KEM-768.
- AtKeyAgreementAlgorithm
- Interface for a Diffie–Hellman key agreement primitive such as X25519.
- AtKeysCrypto
- An abstract class that provides cryptographic operations for AtKeys using specific hashing algorithms.
- AtMlDsa65KeyPair
- AtMlKem768KeyPair
- AtPkamKeyPair
- AtPqc
- Auto-resolves FFI vs pure-Dart PQ backends; libcrypto probed once on first access.
- AtPrivateKey
-
Represents a private key from
AtKeyPair - AtPublicKey
-
Represents a public key from
AtKeyPair - AtSignatureAlgorithm
- Stateless signing interface — all key material passed per call.
- AtSigningAlgorithm
- Interface for data signing. Data is signed using private key from a key pair. Signed data signature is verified with public key of the key pair.
- AtSigningInput
- Represents input attributes required for data signing.
- AtSigningKeyPair
- AtSigningMetaData
- Class which represents metadata for data signing.
- AtSigningResult
- Class that contains the signing/verification result with data type AtSigningResultType and metadata AtSigningMetaData result should be base64Encoded string
- AtSigningVerificationInput
- Input for data signature verification
- AtX25519KeyPair
- AtXWingKeyPair
- DefaultHash
- DefaultHashParams
- DefaultSigningAlgo
- EccSigningAlgo
- Data signing and verification for ECDSA - elliptic curve Uses sha256 hashing for data. Extend implementation for other hashing algorithm in the future.
- Ed25519SigningAlgo
- Data signing and verification for Ed25519 - elliptic curve algorithm Keypair for the algorithm has to generated using AtChopsUtil.generateEd25519KeyPair()
- HashParams
- A class that holds the parameters for configuring a hashing algorithm.
- HkdfSha256
- HKDF-SHA256 (RFC 5869): extract-then-expand key derivation.
- HmacSha256
-
HMAC-SHA256 (RFC 2104). The keyed-hash primitive HKDF is built on; also
usable directly for MACs. Wraps
package:cryptoso consumers depend only on at_chops for keyed hashing. - InitialisationVector
- MlDsa65FfiAlgo
- ML-DSA-65 (FIPS 204) digital signature backed by OpenSSL 3 via Dart FFI.
- MlDsa65KeyPair
- ML-DSA-65 (FIPS 204) signing key pair.
- MlDsa65PureDartAlgo
-
ML-DSA-65 (FIPS 204) digital signature backed by pure-Dart
(
package:pqcrypto). - MlKem768FfiAlgo
- ML-KEM-768 (FIPS 203) KEM backed by OpenSSL 3 via Dart FFI.
- MlKem768KeyPair
- ML-KEM-768 (FIPS 203) key pair used for post-quantum key encapsulation.
- MlKem768PureDartAlgo
-
ML-KEM-768 (FIPS 203) KEM backed by pure-Dart (
package:pqcrypto). - PkamSigningAlgo
- Data signing and verification for Public Key Authentication Mechanism - Pkam
- RsaEncryptionAlgo
- RsaKeyPair
- RsaSigningAlgo
- Data signing and verification using atsign encryption keypair Allowed algorithms are listed in SigningAlgoType and HashingAlgoType
- SHA256HashingAlgo
- SHA512HashingAlgo
- StringAESEncryptor
- A class that provides AES encryption and decryption for strings, implementing the SymmetricEncryptionAlgorithm interface.
-
SymmetricEncryptionAlgorithm<
T, V> - Interface for symmetric encryption algorithms. Check AESEncryptionAlgo for sample implementation.
- SymmetricKey
- Represent a key for symmetric key encryption/decryption
- X25519FfiAlgo
- X25519 Diffie–Hellman key agreement backed by OpenSSL 3 via Dart FFI.
- X25519KeyPair
- X25519 key pair used for Diffie–Hellman key agreement.
- X25519PureDartAlgo
-
X25519 Diffie–Hellman key agreement backed by pure-Dart
(
package:cryptography). - XWingFfiAlgo
- X-Wing hybrid post-quantum/traditional KEM (draft-connolly-cfrg-xwing-kem-10) backed by OpenSSL 3 via Dart FFI.
- XWingKeyPair
- X-Wing hybrid post-quantum/traditional KEM key pair (draft-connolly-cfrg-xwing-kem).
- XWingPureDartAlgo
- X-Wing: general-purpose hybrid post-quantum/traditional KEM combining X25519 and ML-KEM-768, per draft-connolly-cfrg-xwing-kem-10.
Enums
Mixins
- RawKeyPairBytes
- Raw-byte accessors for key pairs whose AtPublicKey/AtPrivateKey strings hold base64-encoded raw key bytes (not DER/PEM) — the PQ and X25519 key pairs. Not for the RSA-family pairs, whose strings are base64-encoded DER.
Functions
-
libCryptoSupportsAesGcm(
DynamicLibrary lib) → bool -
Returns
truewhenlibcan fetch a usable AES-256-GCM cipher. -
libCryptoSupportsMlDsa65(
DynamicLibrary lib) → bool -
Returns
truewhenlibsupports the ML-DSA-65 algorithm. -
libCryptoSupportsMlKem768(
DynamicLibrary lib) → bool -
Returns
truewhenlibsupports the ML-KEM-768 algorithm. -
pqOpen(
AtKemAlgorithm xwing, Uint8List recipientSecretKey, Uint8List envelope, {Uint8List? info, Uint8List? aad}) → Future< Uint8List> -
Open an envelope produced by pqSeal using
recipientSecretKey. -
pqSeal(
AtKemAlgorithm xwing, Uint8List recipientPublicKey, Uint8List plaintext, {Uint8List? info, Uint8List? aad}) → Future< Uint8List> -
Seal
plaintextso only the holder of the secret key paired withrecipientPublicKeycan open it. -
tryLoadLibCrypto(
{StringBuffer? loadedPath}) → DynamicLibrary? -
Try to open libcrypto from the path in
_envVar, then from_candidates.
Exceptions / Errors
- PqOpenException
- Thrown by pqOpen for any failure. Inspect reason.
- PqSealException
- Thrown by pqSeal on caller misuse (e.g. a wrong-length public key).