Encryption modes.
The only currently implemented modes are ECB (Electronic Code Book) and CBC (Cipher Block Chaining).
Array of all known modes.
Cipher block chaining mode.
Default mode (ECB).
Electronic code book mode.
Takes a string or symbol and returns the lowercased symbol representation if this is a recognized mode. Otherwise, throws ArgumentError.
# File lib/twofish/mode.rb, line 24 def self.validate(mode) mode_sym = mode.nil? ? DEFAULT : mode.to_s.downcase.to_sym raise ArgumentError, "unknown cipher mode #{mode.inspect}" unless ALL.include? mode_sym mode_sym end