-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor in AES class and adaptation to new mifiel standar
- Loading branch information
1 parent
0fea25a
commit c2c3a9a
Showing
4 changed files
with
36 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
module Mifiel::Crypto | ||
autoload :PBE, 'mifiel/crypto/pbe' | ||
autoload :Response, 'mifiel/crypto/response' | ||
autoload :AES, 'mifiel/crypto/aes' | ||
autoload :ECIES, 'mifiel/crypto/ecies' | ||
module Mifiel | ||
module Crypto | ||
autoload :PBE, 'mifiel/crypto/pbe' | ||
autoload :Response, 'mifiel/crypto/response' | ||
autoload :AES, 'mifiel/crypto/aes' | ||
autoload :ECIES, 'mifiel/crypto/ecies' | ||
end | ||
end | ||
|
||
class String | ||
def bth | ||
self.unpack('H*').first | ||
unpack('H*').first | ||
end | ||
|
||
def htb | ||
Array(self).pack('H*') | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
module Mifiel | ||
module Crypto | ||
class Response | ||
attr_reader :data | ||
class Response | ||
attr_reader :data | ||
|
||
def ==(other) | ||
data == other.data | ||
end | ||
def ==(other) | ||
data == other.data | ||
end | ||
|
||
def initialize(data) | ||
@data = data | ||
end | ||
def initialize(data) | ||
@data = data | ||
end | ||
|
||
def to_hex | ||
data.unpack('H*').first | ||
def to_hex | ||
data.unpack('H*').first | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters