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_DIGEST_SHA224 = 0x20,
00036 CRAPI_DIGEST_SHA384 = 0x40
00037 } crapi_alg_t;
00038
00039 #define CRAPI_DIGEST_CNT 7
00040
00041 #include "md5.h"
00042 #include "sha1.h"
00043 #include "sha2.h"
00044 #include "rmd160.h"
00045
00046 int crapi_digest_fd (int fd, crapi_alg_t alg, void *dst, size_t *size);
00047
00048 struct digest_ctbl_t {
00049 void *ctx;
00050 void *(*init) (void *, void *);
00051 int (*update)(void *, void *, size_t);
00052 int (*fini) (void *);
00053 void (*free) (void *);
00054 };
00055
00056 int crapi_mdigest_fd (int fd, int num, ... );
00057
00058 #endif