PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hmac.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * hmac.h
4 * Generic headers for HMAC
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * IDENTIFICATION
10 * src/include/common/hmac.h
11 *
12 *-------------------------------------------------------------------------
13 */
14
15#ifndef PG_HMAC_H
16#define PG_HMAC_H
17
18#include "common/cryptohash.h"
19
20/* opaque context, private to each HMAC implementation */
21typedef struct pg_hmac_ctx pg_hmac_ctx;
22
24extern int pg_hmac_init(pg_hmac_ctx *ctx, const uint8 *key, size_t len);
25extern int pg_hmac_update(pg_hmac_ctx *ctx, const uint8 *data, size_t len);
26extern int pg_hmac_final(pg_hmac_ctx *ctx, uint8 *dest, size_t len);
27extern void pg_hmac_free(pg_hmac_ctx *ctx);
28extern const char *pg_hmac_error(pg_hmac_ctx *ctx);
29
30#endif /* PG_HMAC_H */
uint8_t uint8
Definition: c.h:500
pg_cryptohash_type
Definition: cryptohash.h:20
pg_hmac_ctx * pg_hmac_create(pg_cryptohash_type type)
Definition: hmac.c:77
void pg_hmac_free(pg_hmac_ctx *ctx)
Definition: hmac.c:289
const char * pg_hmac_error(pg_hmac_ctx *ctx)
Definition: hmac.c:306
int pg_hmac_update(pg_hmac_ctx *ctx, const uint8 *data, size_t len)
Definition: hmac.c:223
int pg_hmac_init(pg_hmac_ctx *ctx, const uint8 *key, size_t len)
Definition: hmac.c:138
int pg_hmac_final(pg_hmac_ctx *ctx, uint8 *dest, size_t len)
Definition: hmac.c:244
const void size_t len
const void * data
const char * type