8 #include <botan/hash_id.h>
9 #include <botan/exceptn.h>
15 const byte MD2_PKCS_ID[] = {
16 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
17 0xF7, 0x0D, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10 };
19 const byte MD5_PKCS_ID[] = {
20 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
21 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 };
23 const byte RIPEMD_128_PKCS_ID[] = {
24 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
25 0x02, 0x05, 0x00, 0x04, 0x14 };
27 const byte RIPEMD_160_PKCS_ID[] = {
28 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
29 0x01, 0x05, 0x00, 0x04, 0x14 };
31 const byte SHA_160_PKCS_ID[] = {
32 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02,
33 0x1A, 0x05, 0x00, 0x04, 0x14 };
35 const byte SHA_224_PKCS_ID[] = {
36 0x30, 0x2D, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
37 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C };
39 const byte SHA_256_PKCS_ID[] = {
40 0x30, 0x31, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
41 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 };
43 const byte SHA_384_PKCS_ID[] = {
44 0x30, 0x41, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
45 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30 };
47 const byte SHA_512_PKCS_ID[] = {
48 0x30, 0x51, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
49 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 };
51 const byte TIGER_PKCS_ID[] = {
52 0x30, 0x29, 0x30, 0x0D, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04,
53 0x01, 0xDA, 0x47, 0x0C, 0x02, 0x05, 0x00, 0x04, 0x18 };
63 if(name ==
"Parallel(MD5,SHA-160)")
70 if(name ==
"RIPEMD-128")
72 if(name ==
"RIPEMD-160")
84 if(name ==
"Tiger(24,3)")
95 if(name ==
"SHA-160")
return 0x33;
97 if(name ==
"SHA-224")
return 0x38;
98 if(name ==
"SHA-256")
return 0x34;
99 if(name ==
"SHA-384")
return 0x36;
100 if(name ==
"SHA-512")
return 0x35;
102 if(name ==
"RIPEMD-160")
return 0x31;
103 if(name ==
"RIPEMD-128")
return 0x32;
105 if(name ==
"Whirlpool")
return 0x37;
byte ieee1363_hash_id(const std::string &name)
std::invalid_argument Invalid_Argument
MemoryVector< byte > pkcs_hash_id(const std::string &name)