+void echo_large_nextBlock(echo_large_ctx_t* ctx, void* block){
+ ctx->counter += ECHO_LARGE_BLOCKSIZE;
+ compress1024(ctx->v, block, &(ctx->counter), ctx->salt);
+}
+
+void echo_large_lastBlock(echo_large_ctx_t* ctx, void* block, uint16_t length_b){
+ while(length_b>=ECHO_LARGE_BLOCKSIZE){
+ echo_large_nextBlock(ctx, block);
+ block = (uint8_t*)block + ECHO_LARGE_BLOCKSIZE_B;
+ length_b -= ECHO_LARGE_BLOCKSIZE;
+ }
+ uint8_t buffer[ECHO_LARGE_BLOCKSIZE_B];
+ uint64_t total_len;
+ memset(buffer, 0, ECHO_LARGE_BLOCKSIZE_B);
+ memcpy(buffer, block, (length_b+7)/8);
+ buffer[length_b/8] |= 0x80 >> (length_b&7);
+ total_len = (ctx->counter += length_b);
+ if(length_b>=ECHO_LARGE_BLOCKSIZE-144){
+ compress1024(ctx->v, buffer, &total_len, ctx->salt);
+ memset(buffer, 0, ECHO_LARGE_BLOCKSIZE_B);
+ ctx->counter = 0;
+ }
+ if(length_b==0){
+ ctx->counter = 0;
+ }
+ memcpy(buffer+ECHO_LARGE_BLOCKSIZE_B-18, &(ctx->id), 2);
+ memcpy(buffer+ECHO_LARGE_BLOCKSIZE_B-16, &total_len, 8);
+ compress1024(ctx->v, buffer, &(ctx->counter), ctx->salt);
+}
+/******************************************************************************/
+
+void echo_ctx2hash(void* dest, uint16_t length_b, echo_small_ctx_t* ctx){