Class: Miscreant::STREAM::Encryptor
- Inherits:
-
Object
- Object
- Miscreant::STREAM::Encryptor
- Defined in:
- lib/miscreant/stream.rb
Overview
A STREAM encryptor
This corresponds to the ??? stream encryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance
Instance Method Summary collapse
-
#initialize(alg, key, nonce) ⇒ Encryptor
constructor
Create a new STREAM encryptor.
-
#inspect ⇒ String
Inspect this STREAM encryptor instance.
-
#seal(plaintext, ad: "", last_block: false) ⇒ String
Encrypt the next message in the stream.
Constructor Details
Instance Method Details
#inspect ⇒ String
Inspect this STREAM encryptor instance
55 56 57 |
# File 'lib/miscreant/stream.rb', line 55 def inspect to_s end |
#seal(plaintext, ad: "", last_block: false) ⇒ String
Encrypt the next message in the stream
48 49 50 |
# File 'lib/miscreant/stream.rb', line 48 def seal(plaintext, ad: "", last_block: false) @aead.seal(plaintext, nonce: @nonce_encoder.next(last_block), ad: ad) end |