PqForgeStreamCipher.forProvider constructor

PqForgeStreamCipher.forProvider(
  1. PqForgeEngineProvider provider, {
  2. PqForgeCipherSuite cipherSuite = PqForgeCipherSuite.aes256Gcm,
})

Builds a cipher backed by provider — the hardware-acceleration lever.

  • PqForgeEngineProvider.nativeCryptography (the default) — package:cryptography: ~10× faster than PointyCastle even as pure Dart, and it dispatches to AES-NI/ARMv8 hardware when a Flutter host has called FlutterCryptography.enable() (root isolate; fresh isolates fall back to its pure-Dart implementation automatically).
  • PqForgeEngineProvider.pureDart — PointyCastle; the conservative reference backend.

Implementation

factory PqForgeStreamCipher.forProvider(
  PqForgeEngineProvider provider, {
  PqForgeCipherSuite cipherSuite = PqForgeCipherSuite.aes256Gcm,
}) {
  return PqForgeStreamCipher(
    engine: aeadEngineForProvider(provider, cipherSuite: cipherSuite),
  );
}