00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023 #ifndef CRAPI_DIGEST_H
00024 #define CRAPI_DIGEST_H
00025
00026 #include <stdarg.h>
00027 #include <stddef.h>
00028
00029 typedef enum {
00030 CRAPI_DIGEST_MD5 = 0x01,
00031 CRAPI_DIGEST_SHA1 = 0x02,
00032 CRAPI_DIGEST_SHA256 = 0x04,
00033 CRAPI_DIGEST_SHA512 = 0x08,
00034 CRAPI_DIGEST_RMD160 = 0x10
00035 } crapi_alg_t;
00036
00037 #define CRAPI_DIGEST_CNT 5
00038
00039 #include "md5.h"
00040 #include "sha1.h"
00041 #include "sha2.h"
00042 #include "rmd160.h"
00043
00044 int crapi_digest_fd (int fd, crapi_alg_t alg, void *dst, size_t *size);
00045
00046 struct digest_ctbl_t {
00047 void *ctx;
00048 void *(*init) (void *, void *);
00049 int (*update)(void *, void *, size_t);
00050 int (*fini) (void *);
00051 void (*free) (void *);
00052 };
00053
00054 int crapi_mdigest_fd (int fd, int num, ... );
00055
00056 #endif