#ifndef KEM_API_H
#define KEM_API_H

#include "parameters.h"

#define KEM_ALGNAME "Piglet1-Q128"

#define PUBLIC_SEED_BYTES PK_SEED_LEN /**< Seed size of the public key*/

#define KEM_SECRETKEYBYTES SECRET_KEY_BYTES// SK_SEED_LEN /**< Secret key size */
#define KEM_PUBLICKEYBYTES PUBLIC_KEY_BYTES/**< Public key size */
#define KEM_BYTES SHARED_SECRET_BYTES /**< Shared secret size */
#define KEM_CIPHERTEXTBYTES CIPHERTEXT_BYTES /**< Ciphertext size */

int kem_keygen(unsigned char *pk, unsigned char *sk);
int kem_enc(const unsigned char *pk,unsigned char *ss, unsigned char *ct);//xiugai
int kem_dec(const unsigned char *sk, const unsigned char *ct, unsigned char *ss);

//全局参数，定义在 Piglet1.cpp
extern unsigned char Public_Key_Seed[PK_SEED_LEN];//公钥种子
extern unsigned char Public_Key[PUBLIC_KEY_BYTES];//公钥
extern unsigned char Gabidulin_Seed[GD_SEED_LEN];//Gabidulin code 种子

extern unsigned char Secret_Key_Seed[SK_SEED_LEN];//私钥种子
extern unsigned char Secret_Key[SECRET_KEY_BYTES];//私钥


#endif // KEM_API_H
