dedup

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

hash-blake2b.c (453B)


      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 blake2bi(struct hash_ctx *ctx, size_t n)
     12 {
     13 	return blake2b_init(&ctx->u.blake2b_ctx, n);
     14 }
     15 
     16 int
     17 blake2bu(struct hash_ctx *ctx, const void *buf, size_t n)
     18 {
     19 	return blake2b_update(&ctx->u.blake2b_ctx, buf, n);
     20 }
     21 
     22 int
     23 blake2bf(struct hash_ctx *ctx, void *buf, size_t n)
     24 {
     25 	return blake2b_final(&ctx->u.blake2b_ctx, buf, n);
     26 }