Class: Tor257::Key
- Inherits:
-
String
- Object
- String
- Tor257::Key
- Defined in:
- lib/tor257/core.rb
Instance Method Summary collapse
-
#initialize(s) ⇒ Key
constructor
A new instance of Key.
- #subkey(i) ⇒ Object
Constructor Details
#initialize(s) ⇒ Key
Returns a new instance of Key.
28 29 30 31 |
# File 'lib/tor257/core.rb', line 28 def initialize s super(s) raise ArgumentError, "Key must be at least 32 bits strong" if size() < 4 end |
Instance Method Details
#subkey(i) ⇒ Object
33 34 35 36 37 |
# File 'lib/tor257/core.rb', line 33 def subkey(i) # return self[i % self.size].bytes @koff = nil _subkey(i % self.size) end |