Example #1
0
 /// <summary>
 /// Initializes a new AEAD instance using the AES-PMAC-SIV algorithm.
 /// </summary>
 /// <param name="key">The secret key for AES-PMAC-SIV encryption.</param>
 /// <returns>An AEAD instance.</returns>
 public static Aead CreateAesPmacSiv(byte[] key)
 {
     return(new Aead(AesSiv.CreateAesPmacSiv(key)));
 }
        /// <summary>
        /// Initializes a new instance of the STREAM encryptor using the AES-PMAC-SIV algorithm.
        /// </summary>
        /// <param name="key">The secret key for encryption.</param>
        /// <param name="nonce">The nonce for encryption.</param>
        /// <returns>A STREAM encryptor instance.</returns>
        public static StreamEncryptor CreateAesPmacSivEncryptor(byte[] key, byte[] nonce)
        {
            var siv = AesSiv.CreateAesPmacSiv(key);

            return(new StreamEncryptor(siv, nonce));
        }
Example #3
0
 private Aead(AesSiv siv)
 {
     this.siv = siv;
 }
 private StreamEncryptor(AesSiv siv, byte[] nonce)
 {
     this.siv   = siv;
     this.nonce = new NonceEncoder(nonce);
 }