libswarm-ng

C implementation of BMT hasher, Swarmhash and Single Owner Chunk for swarm
git clone git://git.defalsify.org/libswarm-ng.git
Info | Log | Files | Refs | Submodules | README

chunk.h (416B)


      1 #ifndef _LIBSWARM_CHUNK_H
      2 #define _LIBSWARM_CHUNK_H
      3 
      4 #include "def.h"
      5 
      6 typedef struct swarm_chunk {
      7 	unsigned char hash[SWARM_WORD_SIZE];
      8 	unsigned char span[SWARM_DATA_LENGTH_TYPESIZE];
      9 	size_t payload_sz;
     10 	unsigned char *payload;
     11 } swarm_chunk_t;
     12 
     13 unsigned char* chunk_serialize(const swarm_chunk_t *chunk, unsigned char *z, size_t *sz);
     14 int chunk_verify(const swarm_chunk_t *chunk);
     15 	
     16 #endif // _LIBSWARM_CHUNK_H