123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- #ifndef EPID_MEMBER_TINY_MATH_SERIALIZE_H_
- #define EPID_MEMBER_TINY_MATH_SERIALIZE_H_
- #include <stddef.h>
- #include <stdint.h>
- typedef struct OctStr32 OctStr32;
- typedef struct VeryLargeInt VeryLargeInt;
- typedef struct BigNumStr BigNumStr;
- typedef struct FqElem FqElem;
- typedef struct FqElemStr FqElemStr;
- typedef struct FpElem FpElem;
- typedef struct FpElemStr FpElemStr;
- typedef struct EccPointFq EccPointFq;
- typedef struct G1ElemStr G1ElemStr;
- typedef struct EccPointFq2 EccPointFq2;
- typedef struct G2ElemStr G2ElemStr;
- typedef struct Fq12Elem Fq12Elem;
- typedef struct Fq12ElemStr Fq12ElemStr;
- #if !defined(UNOPTIMIZED_SERIALIZATION)
- void SwapNativeAndPortableLayout(void* dest, size_t dest_size, void const* src,
- size_t src_size);
- #endif
- void* Uint32Serialize(OctStr32* dest, uint32_t src);
- void const* Uint32Deserialize(uint32_t* dest, OctStr32 const* src);
- void* VliSerialize(BigNumStr* dest, VeryLargeInt const* src);
- void const* VliDeserialize(VeryLargeInt* dest, BigNumStr const* src);
- void* FqSerialize(FqElemStr* dest, FqElem const* src);
- void const* FqDeserialize(FqElem* dest, FqElemStr const* src);
- void* Fq12Serialize(Fq12ElemStr* dest, Fq12Elem const* src);
- void const* Fq12Deserialize(Fq12Elem* dest, Fq12ElemStr const* src);
- void* FpSerialize(FpElemStr* dest, FpElem const* src);
- void const* FpDeserialize(FpElem* dest, FpElemStr const* src);
- void* EFqSerialize(G1ElemStr* dest, EccPointFq const* src);
- void const* EFqDeserialize(EccPointFq* dest, G1ElemStr const* src);
- void* EFq2Serialize(G2ElemStr* dest, EccPointFq2 const* src);
- void const* EFq2Deserialize(EccPointFq2* dest, G2ElemStr const* src);
- #endif
|