Add initial crypto functionality
[libcontrac.git] / include / contrac / contrac.h
1 /** \ingroup contrac
2 * @file
3 * @author David Llewellyn-Jones
4 * @version $(VERSION)
5 *
6 * @section LICENSE
7 *
8 *
9 *
10 * @brief
11 * @section DESCRIPTION
12 *
13 *
14 *
15 */
16
17 #ifndef __CONTRAC_H
18 #define __CONTRAC_H
19
20 // Includes
21
22 #include <stdint.h>
23 #include <stdbool.h>
24
25 // Defines
26
27 // Data sizes in bytes
28 #define TK_SIZE (32)
29 #define TK_SIZE_BASE64 (44)
30
31 // Structures
32
33 typedef struct _Contrac Contrac;
34
35 // Function prototypes
36
37 Contrac * contrac_new();
38 void contrac_delete(Contrac * data);
39
40 bool contrac_generate_tracing_key(Contrac * data);
41 bool contrac_set_day_number(Contrac * data, uint32_t day_number);
42 bool contrac_set_time_interval_number(Contrac * data, uint8_t time_interval_number);
43 bool contrac_get_initialised(Contrac const * data);
44
45 const unsigned char * contrac_get_tracing_key(Contrac const * data);
46 void contrac_get_tracing_key_base64(Contrac const * data, char * base64);
47
48 const unsigned char * contrac_get_daily_key(Contrac const * data);
49 void contrac_get_daily_key_base64(Contrac const * data, char * base64);
50
51 const unsigned char * contrac_get_proximity_id(Contrac const * data);
52 void contrac_get_proximity_id_base64(Contrac const * data, char * base64);
53
54 // Function definitions
55
56 #endif // __CONTRAC_H
57