Fix bug switching to odd parity

This commit is contained in:
Dan Milne
2011-12-02 20:53:20 +11:00
parent f3446f333e
commit a19e20a6ef

View File

@@ -68,7 +68,7 @@ module HSMR
end
def set_odd_parity
return true if self.odd_parity? == true
return self if self.odd_parity? == true
working=@key.unpack('H2'*(@key.length))
working.each_with_index do |o,i|
@@ -97,6 +97,7 @@ module HSMR
end
end
@key = working.join.unpack('a2'*(working.length)).map{|x| x.hex}.pack('c'*(working.length))
return self
end
def xor(other)