Class: ElGamal::Ciphertext
- Inherits:
-
Object
- Object
- ElGamal::Ciphertext
- Defined in:
- lib/elgamal/ciphertext.rb
Instance Attribute Summary collapse
-
#ciphertext ⇒ Object
Returns the value of attribute ciphertext.
Instance Method Summary collapse
- #[](pos) ⇒ Object
-
#initialize(ciphertext) ⇒ Ciphertext
constructor
A new instance of Ciphertext.
- #to_s ⇒ Object
Constructor Details
#initialize(ciphertext) ⇒ Ciphertext
Returns a new instance of Ciphertext.
5 6 7 8 |
# File 'lib/elgamal/ciphertext.rb', line 5 def initialize(ciphertext) raise ArgumentError.new("Required a tuple input, eg. [123,456]") unless ciphertext.class == Array and ciphertext.length == 2 @ciphertext = ciphertext end |
Instance Attribute Details
#ciphertext ⇒ Object
Returns the value of attribute ciphertext.
10 11 12 |
# File 'lib/elgamal/ciphertext.rb', line 10 def ciphertext @ciphertext end |
Instance Method Details
#[](pos) ⇒ Object
16 17 18 |
# File 'lib/elgamal/ciphertext.rb', line 16 def [](pos) return @ciphertext[pos] end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/elgamal/ciphertext.rb', line 12 def to_s @ciphertext.to_s end |