#ifndef FILE_H_INCLUDED
#define FILE_H_INCLUDED
#include "gmp.h"

#define KAZ_KA_SP_J						96
#define KAZ_KA_SP_SL					192

#define KAZ_KA_SP_N						"15982040643598444277320371265136974856402799594720686504760818091215333991414038871394426514903965899103553442859146701270930684879295849706045338879593833465052745734862675359470536861467492521046077102660572015"
#define KAZ_KA_SP_LN					702 // in binary (88 bytes)

#define KAZ_KA_SP_g1					"65563"
#define KAZ_KA_SP_g2					"65617"

#define KAZ_KA_SP_Og1N					"51736000959480087314595638140051513827162226171393634016000"
#define KAZ_KA_SP_LOg1N					196 // in binary (25 bytes)
#define KAZ_KA_SP_Og2N					"155208002878440261943786914420154541481486678514180902048000"
#define KAZ_KA_SP_LOg2N					197 // in binary (25 bytes)

#define KAZ_KA_PUBLICKEY_BYTES			88 // in bytes for each e1, e2
#define KAZ_KA_PRIVATEKEY_BYTES			25 // in bytes for each a1, a2

#define KAZ_KA_SHAREDKEY_BYTES			88 // in bytes for shared key

extern void init_random();
extern void clear_random();
extern void KAZ_KA_RANDOM(mpz_t lb, mpz_t ub, mpz_t out);

extern int KAZ_KA_KEYGEN(unsigned char *kaz_ka_public_key, 
                         unsigned char *kaz_ka_private_key, 
                         const unsigned char *kaz_ka_types);

extern int KAZ_KEY_AGREEMENT(unsigned char *sharedkey, 
                             const unsigned char *kaz_ka_public_key_slave, 
                             const unsigned char *kaz_ka_private_key_primary);

#endif // FILE_H_INCLUDED
