OxL Справочник OxL
РусскийEnglish

method aead.seal

AES-256-GCM.

Example:

oxl✓ проверяется в CI
use std.crypto { aead, rand }
use std.ser { bytesOf, textOf }

fn main() io, rand {
  let key = rand.secure(32)
  let sealed = aead.seal(key, bytesOf(&"secret"))!
  print(textOf(&aead.unseal(key, sealed)!)!)
}
Вывод
secret
pub(api) static fn seal(key: bytes, plain: bytes, aad: bytes = b"") -> bytes | CryptoError  rand

С версии. 1.0.0-beta

Параметры

ИмяТип
keybytes
plainbytes
aadbytes = b""

Возвращает

bytes

Ошибки

Эффекты

rand

Определено в: std/crypto/crypto.oxl:451

См. также