Пример #1
0
 public xorNonceAEAD(array <byte> nonceMask = default, cipher.AEAD aead = default)
 {
     this.nonceMask = nonceMask;
     this.aead      = aead;
 }
Пример #2
0
 // NewGCM returns the AES cipher wrapped in Galois Counter Mode. This is only
 // called by crypto/cipher.NewGCM via the gcmAble interface.
 private static (cipher.AEAD, error) NewGCM(this ptr <aesCipherAsm> _addr_c, long nonceSize, long tagSize)
 {
     cipher.AEAD      _p0 = default;
     error            _p0 = default !;
Пример #3
0
 // NewX returns a XChaCha20-Poly1305 AEAD that uses the given 256-bit key.
 //
 // XChaCha20-Poly1305 is a ChaCha20-Poly1305 variant that takes a longer nonce,
 // suitable to be generated randomly without risk of collisions. It should be
 // preferred when nonce uniqueness cannot be trivially ensured, or whenever
 // nonces are randomly generated.
 public static (cipher.AEAD, error) NewX(slice <byte> key)
 {
     cipher.AEAD _p0 = default;
     error       _p0 = default !;
Пример #4
0
 public prefixNonceAEAD(array <byte> nonce = default, cipher.AEAD aead = default)
 {
     this.nonce = nonce;
     this.aead  = aead;
 }