Decryptor constructor
Decryptor({
- OtpCryptoConfig? config,
Creates a Decryptor bound to OtpCryptoConfig.
config
Defaults to the global singleton OtpCryptoConfig.instance
.
HINT: Instantiate once and reuse; keys are derived in the constructor.
Implementation
Decryptor({OtpCryptoConfig? config})
: _cfg = config ?? OtpCryptoConfig.instance,
_keys = HkdfSha256.deriveKeys(
masterKey: (config ?? OtpCryptoConfig.instance).masterKey,
salt: (config ?? OtpCryptoConfig.instance).hkdfSalt,
info: (config ?? OtpCryptoConfig.instance).hkdfInfo,
);