PostgreSQL Source Code  git master
cryptohash.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * cryptohash.h
4  * Generic headers for cryptographic hash functions.
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * IDENTIFICATION
10  * src/include/common/cryptohash.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 
15 #ifndef PG_CRYPTOHASH_H
16 #define PG_CRYPTOHASH_H
17 
18 /* Context Structures for each hash function */
19 typedef enum
20 {
21  PG_MD5 = 0,
28 
29 /* opaque context, private to each cryptohash implementation */
31 
33 extern int pg_cryptohash_init(pg_cryptohash_ctx *ctx);
34 extern int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len);
35 extern int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len);
36 extern void pg_cryptohash_free(pg_cryptohash_ctx *ctx);
37 
38 #endif /* PG_CRYPTOHASH_H */
void pg_cryptohash_free(pg_cryptohash_ctx *ctx)
Definition: cryptohash.c:216
unsigned char uint8
Definition: c.h:439
union pg_cryptohash_ctx::@35 data
pg_cryptohash_ctx * pg_cryptohash_create(pg_cryptohash_type type)
Definition: cryptohash.c:66
int pg_cryptohash_init(pg_cryptohash_ctx *ctx)
Definition: cryptohash.c:92
pg_cryptohash_type
Definition: cryptohash.h:19
int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len)
Definition: cryptohash.c:168
int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
Definition: cryptohash.c:130