Class: Ccrypto::DigestConfig

Inherits:
Object
  • Object
show all
Includes:
AlgoConfig, TR::CondUtils
Defined in:
lib/ccrypto/configs/digest_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AlgoConfig

include

Constructor Details

#initialize(algo, outBitLen, opts = { }) ⇒ DigestConfig

Returns a new instance of DigestConfig.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ccrypto/configs/digest_config.rb', line 12

def initialize(algo, outBitLen, opts = {  })
  @algo = algo
  @outBitLength = outBitLen
  @outByteLength = @outBitLength/8

  if not_empty?(opts)
    @provider_config = opts[:provider_config]
    @fixed_input_len_byte = opts[:fixed_input_len_byte] || -1
  else
    @provider_config = {}
    @fixed_input_len_byte = -1
  end
end

Instance Attribute Details

#algoObject (readonly)

Returns the value of attribute algo.



8
9
10
# File 'lib/ccrypto/configs/digest_config.rb', line 8

def algo
  @algo
end

#fixed_input_len_byteObject (readonly)

Returns the value of attribute fixed_input_len_byte.



9
10
11
# File 'lib/ccrypto/configs/digest_config.rb', line 9

def fixed_input_len_byte
  @fixed_input_len_byte
end

#outBitLengthObject (readonly)

Returns the value of attribute outBitLength.



8
9
10
# File 'lib/ccrypto/configs/digest_config.rb', line 8

def outBitLength
  @outBitLength
end

#outByteLengthObject (readonly)

Returns the value of attribute outByteLength.



8
9
10
# File 'lib/ccrypto/configs/digest_config.rb', line 8

def outByteLength
  @outByteLength
end

#provider_configObject

variable allow provider to put things related to the provider e.g. JCE provider etc



11
12
13
# File 'lib/ccrypto/configs/digest_config.rb', line 11

def provider_config
  @provider_config
end

Instance Method Details

#has_fixed_input_len_byte?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/ccrypto/configs/digest_config.rb', line 26

def has_fixed_input_len_byte?
  @fixed_input_len_byte != -1
end