You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.6 KiB
45 lines
1.6 KiB
|
|
#ifndef ECDAA_COMMON_H
|
|
#define ECDAA_COMMON_H
|
|
|
|
#include <sys/random.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
|
|
#define DEBUG //enable on screen debug information
|
|
|
|
#define ISSUERPORT 6590
|
|
#define MEMBERPORT 6591
|
|
#define VERIFIERPORT 6592
|
|
|
|
#define MAX_CLIENTS 10
|
|
#define MAX_MSGSIZE 15000
|
|
#define MAX_CHKSUMSIZE 1024
|
|
#define MAX_BUFSIZE (((MAX_MSGSIZE + 2) / 3) * 4) + (((MAX_CHKSUMSIZE + 2) / 3) * 4) + 1536
|
|
/* #define MAX_MSGSIZE ((MAX_BUFSIZE - 1536) / 2) - MAX_CHKSUMSIZE //for bin to hex*/
|
|
/* #define MAX_MSGSIZE ((MAX_BUFSIZE - 1536) / 4 * 3) - MAX_CHKSUMSIZE //for base64 */
|
|
#define MAX_BSNSIZE 128
|
|
#define NONCE_SIZE 384
|
|
|
|
const char* issuer_public_key_file = "ipk.bin";
|
|
const char* issuer_secret_key_file = "isk.bin";
|
|
const char* member_tpm_handle_file = "tpmhndl.bin"; //Handle to access tpm key
|
|
const char* member_tpm_key_file = "tpmpk.bin"; //public key to access TPM key (!= mpk)
|
|
const char* member_secret_key_file = "msk.bin"; //for TPM less members only
|
|
const char* member_public_key_file = "mpk.bin";
|
|
const char* member_credential_file = "mcred.bin";
|
|
const char* member_nonce_file = "mnonce.bin";
|
|
const char* verifier_group_pk_file = "gpk.bin";
|
|
const char* message_file = "msg.txt"; //Checksum of message in chksum.txt
|
|
const char* checksum_file = "chksum.txt"; //Only this file is signed due to 1024 bytes size limit
|
|
|
|
typedef int (*conn_handler)(char *buffer);
|
|
|
|
void ecdaa_rand(void *buffer, size_t buflen);
|
|
|
|
size_t ecdaa_decode(const char *in_enc, uint8_t *out_dec, size_t outlen);
|
|
|
|
size_t ecdaa_encode(const uint8_t *in_dec, char *out_enc, size_t inlen);
|
|
|
|
#endif //ECDAA_COMMON_H
|
|
|