diff options
author | Jack Lloyd <[email protected]> | 2016-07-27 15:55:08 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-27 15:55:08 -0400 |
commit | cf490273af9f1a8595f373b9052442675205fe9e (patch) | |
tree | 9368766b7afe3362ccb5afd20808cf79895f5a39 | |
parent | 803f7614558d8fb7ec608c1ebebdb4938cd0b8fb (diff) | |
parent | 244e56240f39df1f7fb757f88b086da9fffd383e (diff) |
Merge GH #554 Add PKCS #1 v1.5 ID for SHA-512/256 signatures
-rw-r--r-- | src/lib/pk_pad/hash_id/hash_id.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/pk_pad/hash_id/hash_id.cpp b/src/lib/pk_pad/hash_id/hash_id.cpp index 28bbea346..882c30a4c 100644 --- a/src/lib/pk_pad/hash_id/hash_id.cpp +++ b/src/lib/pk_pad/hash_id/hash_id.cpp @@ -48,6 +48,10 @@ const byte SHA_512_PKCS_ID[] = { 0x30, 0x51, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }; +const byte SHA_512_256_PKCS_ID[] = { +0x30, 0x31, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, +0x65, 0x03, 0x04, 0x02, 0x06, 0x05, 0x00, 0x04, 0x20 }; + const byte TIGER_PKCS_ID[] = { 0x30, 0x29, 0x30, 0x0D, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0C, 0x02, 0x05, 0x00, 0x04, 0x18 }; @@ -99,6 +103,10 @@ std::vector<byte> pkcs_hash_id(const std::string& name) return std::vector<byte>(SHA_512_PKCS_ID, SHA_512_PKCS_ID + sizeof(SHA_512_PKCS_ID)); + if(name == "SHA-512-256") + return std::vector<byte>(SHA_512_256_PKCS_ID, + SHA_512_256_PKCS_ID + sizeof(SHA_512_256_PKCS_ID)); + if(name == "Tiger(24,3)") return std::vector<byte>(TIGER_PKCS_ID, TIGER_PKCS_ID + sizeof(TIGER_PKCS_ID)); |