Class: Stribog::CompressionFunc
- Inherits:
-
Object
- Object
- Stribog::CompressionFunc
- Includes:
- HashParams
- Defined in:
- lib/stribog/compression_func.rb
Overview
Compression
Class implements compression function of GOST R 34.11-2012 algorithm.
Constant Summary
Constants included from HashParams
HashParams::CONSTANTS_C, HashParams::MATRIX_A, HashParams::PI, HashParams::T
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(n, message, hash_vector) ⇒ CompressionFunc
constructor
A new instance of CompressionFunc.
Constructor Details
#initialize(n, message, hash_vector) ⇒ CompressionFunc
Returns a new instance of CompressionFunc.
9 10 11 12 13 |
# File 'lib/stribog/compression_func.rb', line 9 def initialize(n, , hash_vector) @n = n @message = @hash_vector = hash_vector end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 |
# File 'lib/stribog/compression_func.rb', line 15 def call vector = lpsx_func @n, @hash_vector vector = func_e vector, @message vector = vector ^ @hash_vector vector ^ @message end |