5 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
6 0xF7, 0x0D, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10 };
9 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
10 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 };
13 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
14 0x02, 0x05, 0x00, 0x04, 0x14 };
17 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
18 0x01, 0x05, 0x00, 0x04, 0x14 };
21 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02,
22 0x1A, 0x05, 0x00, 0x04, 0x14 };
25 0x30, 0x2D, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
26 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C };
29 0x30, 0x31, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
30 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 };
33 0x30, 0x41, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
34 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30 };
37 0x30, 0x51, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
38 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 };
41 0x30, 0x29, 0x30, 0x0D, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04,
42 0x01, 0xDA, 0x47, 0x0C, 0x02, 0x05, 0x00, 0x04, 0x18 };
44 static inline void get_hash_properties(
const uint8_t **
id,
int * id_len,
int * digest_len,
tc_hash_type_t hash_type) {
63 const uint8_t *hash_desc;
64 int hash_desc_len, digest_len;
66 get_hash_properties(&hash_desc, &hash_desc_len, &digest_len, hash_type);
68 assert(digest->
data_len <= digest_len);
70 int D_len = digest_len + hash_desc_len;
71 int P_len = k - 3 - D_len;
73 uint8_t *p = out->
data;
78 memset(p, 0xFF, P_len);
82 if (hash_desc != NULL) {
83 memcpy(p, hash_desc, hash_desc_len);
100 MHASH sha = mhash_init(MHASH_SHA256);
102 mhash_deinit(sha, hash);
118 assert(digest.
data_len <= data_len);
119 tc_pkcs1_encoding(out, &digest, hash_type);
bytes_t * tc_prepare_document(const bytes_t *doc, tc_hash_type_t hash_type, const key_metainfo_t *metainfo)
const uint8_t RIPEMD_128_PKCS_ID[]
Structure that's stores a pointer that points to data_len bytes.
const uint8_t MD2_PKCS_ID[]
const uint8_t RIPEMD_160_PKCS_ID[]
const uint8_t TIGER_PKCS_ID[]
const uint8_t SHA_160_PKCS_ID[]
const uint8_t SHA_512_PKCS_ID[]
const uint8_t MD5_PKCS_ID[]
enum tc_hash_type tc_hash_type_t
const uint8_t SHA_224_PKCS_ID[]
bytes_t * tc_init_bytes(void *bs, size_t len)
const uint8_t SHA_256_PKCS_ID[]
const uint8_t SHA_384_PKCS_ID[]