#ifndef _CK_BYTEREP_H_
#define _CK_BYTEREP_H_
#include "feeTypes.h"
#include "giantIntegers.h"
#include "elliptic.h"
#include "curveParams.h"
#ifdef __cplusplus
extern "C" {
#endif
int intToByteRep(int i, unsigned char *buf);
int shortToByteRep(short s, unsigned char *buf);
int giantToByteRep(giant g, unsigned char *buf);
int keyToByteRep(key k, unsigned char *buf);
int curveParamsToByteRep(curveParams *cp, unsigned char *buf);
int sigToByteRep(int magic,
int version,
int minVersion,
giant g0,
giant g1,
unsigned char *buf);
int lengthOfByteRepGiant(giant g);
int lengthOfByteRepKey(key k);
int lengthOfByteRepCurveParams(curveParams *cp);
int lengthOfByteRepSig(giant g0,
giant g1);
int byteRepToInt(const unsigned char *buf);
unsigned short byteRepToShort(const unsigned char *buf);
giant byteRepToGiant(const unsigned char *buf,
unsigned bufLen,
unsigned *giantLen);
key byteRepToKey(const unsigned char *buf,
unsigned bufLen,
int twist,
curveParams *cp,
unsigned *keyLen); curveParams *byteRepToCurveParams(const unsigned char *buf,
unsigned bufLen,
unsigned *cpLen);
int byteRepToSig(const unsigned char *buf,
unsigned bufLen,
int codeVersion,
int *sigMagic, int *sigVersion, int *sigMinVersion, giant *g0, giant *g1);
#ifdef __cplusplus
}
#endif
#endif