Class: Stribog::Compression

Inherits:
Object
  • Object
show all
Includes:
HashParams
Defined in:
lib/stribog/compression.rb

Overview

Compression

Author:

  • WildDima

Constant Summary

Constants included from HashParams

HashParams::CONSTANTS_C, HashParams::MATRIX_A, HashParams::PI, HashParams::T

Instance Method Summary collapse

Constructor Details

#initialize(n, message, hash_vector) ⇒ Compression

Returns a new instance of Compression.



10
11
12
13
14
# File 'lib/stribog/compression.rb', line 10

def initialize(n, message, hash_vector)
  @n = n
  @message = message
  @hash_vector = hash_vector
end

Instance Method Details

#callObject



16
17
18
19
20
21
# File 'lib/stribog/compression.rb', line 16

def call
  vector = lpsx_func @n, @hash_vector
  vector = func_e vector, @message
  vector = vector ^ @hash_vector
  vector ^ @message
end