Permalink
Browse files

* add some algorithm support.

  • Loading branch information...
1 parent 94c9bc5 commit c1b5e408d215f91a90a8915aca2c6e167fb88ade @nahi committed Oct 30, 2004
Showing with 6 additions and 0 deletions.
  1. +4 −0 lib/pgp/hashalgorithm.rb
  2. +2 −0 lib/pgp/pkeyalgorithm.rb
View
4 lib/pgp/hashalgorithm.rb
@@ -17,6 +17,10 @@ module HashAlgorithm
3 => ["RIPEMD-160", 20, [0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24,
0x03, 0x02, 0x01, 0x05, 0x00, 0x04, 0x14]],
# SHA256: 2.16.840.1.101.3.4.2.1
+ 4 => ["Reserved"],
+ 5 => ["Reserved"],
+ 6 => ["Reserved"],
+ 7 => ["Reserved"],
8 => ["SHA256", 32, [0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48,
0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20]],
# SHA384: 2.16.840.1.101.3.4.2.2
View
2 lib/pgp/pkeyalgorithm.rb
@@ -47,6 +47,8 @@ def self.dump_signature(algorithm, signature)
"m**d mod n - #{MPI.nbits(signature)} bits"
when 17
"r - #{MPI.nbits(signature[0])} bits, s - #{MPI.nbits(signature[1])} bits"
+ when 16, 20
+ "??? (#{signature.size} bytes)"
else
raise "Not supported: #{algorithm}"
end

0 comments on commit c1b5e40

Please sign in to comment.