dedup

data deduplication program
git clone git://git.2f30.org/dedup.git
Log | Files | Refs | README | LICENSE

hash-blake2sp.c (462B)


      1 #include <sys/types.h>
      2 
      3 #include <stdint.h>
      4 #include <stdlib.h>
      5 #include <string.h>
      6 
      7 #include "blake2.h"
      8 #include "dedup.h"
      9 
     10 int
     11 blake2spi(struct hash_ctx *ctx, size_t n)
     12 {
     13 	return blake2sp_init(&ctx->u.blake2sp_ctx, n);
     14 }
     15 
     16 int
     17 blake2spu(struct hash_ctx *ctx, const void *buf, size_t n)
     18 {
     19 	return blake2sp_update(&ctx->u.blake2sp_ctx, buf, n);
     20 }
     21 
     22 int
     23 blake2spf(struct hash_ctx *ctx, void *buf, size_t n)
     24 {
     25 	return blake2sp_final(&ctx->u.blake2sp_ctx, buf, n);
     26 }