libtc  20160415
Threshold Cryptography functions library
Functions | Variables
algorithms_pkcs1_encoding.c File Reference
#include <mhash.h>
#include "tc_internal.h"

Go to the source code of this file.

Functions

bytes_ttc_prepare_document (const bytes_t *doc, tc_hash_type_t hash_type, const key_metainfo_t *metainfo)
 

Variables

const uint8_t MD2_PKCS_ID []
 
const uint8_t MD5_PKCS_ID []
 
const uint8_t RIPEMD_128_PKCS_ID []
 
const uint8_t RIPEMD_160_PKCS_ID []
 
const uint8_t SHA_160_PKCS_ID []
 
const uint8_t SHA_224_PKCS_ID []
 
const uint8_t SHA_256_PKCS_ID []
 
const uint8_t SHA_384_PKCS_ID []
 
const uint8_t SHA_512_PKCS_ID []
 
const uint8_t TIGER_PKCS_ID []
 

Function Documentation

bytes_t* tc_prepare_document ( const bytes_t doc,
tc_hash_type_t  hash_type,
const key_metainfo_t metainfo 
)

Function that hashes and adds the PKCS1 padding to the document to be signed. This function should be only used in testing environments. In production environments, any function that does the PSS padding should be used. Such functions are provided by general cryptography suites such as OpenSSL or Botan.

Parameters
[in]docthe document to be prepared.
[in]hash_typethe hash function to be used in the document.
[in]metainfothe metainfo of the key shares array, with the public key.
Returns
the prepared document.

Definition at line 91 of file algorithms_pkcs1_encoding.c.

Variable Documentation

const uint8_t MD2_PKCS_ID[]
Initial value:
= {
0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
0xF7, 0x0D, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10 }

Definition at line 4 of file algorithms_pkcs1_encoding.c.

const uint8_t MD5_PKCS_ID[]
Initial value:
= {
0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86,
0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 }

Definition at line 8 of file algorithms_pkcs1_encoding.c.

const uint8_t RIPEMD_128_PKCS_ID[]
Initial value:
= {
0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
0x02, 0x05, 0x00, 0x04, 0x14 }

Definition at line 12 of file algorithms_pkcs1_encoding.c.

const uint8_t RIPEMD_160_PKCS_ID[]
Initial value:
= {
0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24, 0x03, 0x02,
0x01, 0x05, 0x00, 0x04, 0x14 }

Definition at line 16 of file algorithms_pkcs1_encoding.c.

const uint8_t SHA_160_PKCS_ID[]
Initial value:
= {
0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02,
0x1A, 0x05, 0x00, 0x04, 0x14 }

Definition at line 20 of file algorithms_pkcs1_encoding.c.

const uint8_t SHA_224_PKCS_ID[]
Initial value:
= {
0x30, 0x2D, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C }

Definition at line 24 of file algorithms_pkcs1_encoding.c.

const uint8_t SHA_256_PKCS_ID[]
Initial value:
= {
0x30, 0x31, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }

Definition at line 28 of file algorithms_pkcs1_encoding.c.

const uint8_t SHA_384_PKCS_ID[]
Initial value:
= {
0x30, 0x41, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30 }

Definition at line 32 of file algorithms_pkcs1_encoding.c.

const uint8_t SHA_512_PKCS_ID[]
Initial value:
= {
0x30, 0x51, 0x30, 0x0D, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }

Definition at line 36 of file algorithms_pkcs1_encoding.c.

const uint8_t TIGER_PKCS_ID[]
Initial value:
= {
0x30, 0x29, 0x30, 0x0D, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04,
0x01, 0xDA, 0x47, 0x0C, 0x02, 0x05, 0x00, 0x04, 0x18 }

Definition at line 40 of file algorithms_pkcs1_encoding.c.