# rpmio/digest.c File Reference

`#include "system.h"`
`#include <zlib.h>`
`#include "rpmio_internal.h"`
`#include <rpmbc.h>`
`#include "md2.h"`
`#include <beecrypt/beecrypt.h>`
`#include "debug.h"`
Include dependency graph for digest.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | sum32Param
struct | sum64Param
struct | DIGEST_CTX_s
| MD5/SHA1 digest private data. More...

## Defines

#define | DPRINTF(_a)
#define | _JLU3_jlu32l
#define | GF2_DIM 64

## Functions

static uint32_t | crc32 (uint32_t crc, const byte *data, size_t size)
static int | sum32Reset (register sum32Param *mp)
static int | sum32Update (sum32Param *mp, const byte *data, size_t size)
static int | sum32Digest (sum32Param *mp, byte *data)
static uint64_t | crc64 (uint64_t crc, const byte *data, size_t size)
static uint64_t | gf2_matrix_times (uint64_t *mat, uint64_t vec)
static void | gf2_matrix_square (uint64_t *square, uint64_t *mat)
static uint64_t | crc64_combine (uint64_t crc1, uint64_t crc2, size_t len2)
static int | sum64Reset (register sum64Param *mp)
static int | sum64Update (sum64Param *mp, const byte *data, size_t size)
static int | sum64Digest (sum64Param *mp, byte *data)
DIGEST_CTX | rpmDigestDup (DIGEST_CTX octx)
| Duplicate a digest context.
DIGEST_CTX | rpmDigestInit (pgpHashAlgo hashalgo, rpmDigestFlags flags)
| Initialize digest.
int | rpmDigestUpdate (DIGEST_CTX ctx, const void *data, size_t len)
| Update context with next plain text buffer.
int | rpmDigestFinal (DIGEST_CTX ctx, void *datap, size_t *lenp, int asAscii)
| Return digest and destroy context.

## Variables

pgpHashAlgo | rpmDigestHashAlgo = PGPHASHALGO_MD5
struct poptOption | rpmDigestPoptTable []
| Digest options using popt.

## Detailed Description

Definition in file digest.c.

## Define Documentation

#define _JLU3_jlu32l

Definition at line 75 of file digest.c.

#define DPRINTF | ( | _a |  | ) |

Definition at line 29 of file digest.c.

Referenced by rpmDigestFinal(), rpmDigestInit(), and rpmDigestUpdate().

#define GF2_DIM 64

Definition at line 170 of file digest.c.

Referenced by crc64_combine(), and gf2_matrix_square().

## Function Documentation

static uint32_t crc32 | ( | uint32_t | crc,
|  | const byte * | data,
|  | size_t | size |
| ) |  |  | `[static]`

Definition at line 36 of file digest.c.

Referenced by rpmDigestInit().

static uint64_t crc64 | ( | uint64_t | crc,
|  | const byte * | data,
|  | size_t | size |
| ) |  |  | `[static]`

Definition at line 129 of file digest.c.

Referenced by rpmDigestInit().

static uint64_t crc64_combine | ( | uint64_t | crc1,
|  | uint64_t | crc2,
|  | size_t | len2 |
| ) |  |  | `[static]`

Definition at line 202 of file digest.c.

References GF2_DIM, gf2_matrix_square(), and gf2_matrix_times().

Referenced by rpmDigestInit().

static void gf2_matrix_square | ( | uint64_t * | square,
|  | uint64_t * | mat |
| ) |  |  | `[static]`

Definition at line 191 of file digest.c.

References GF2_DIM, and gf2_matrix_times().

Referenced by crc64_combine().

static uint64_t gf2_matrix_times | ( | uint64_t * | mat,
|  | uint64_t | vec |
| ) |  |  | `[static]`

Definition at line 174 of file digest.c.

Referenced by crc64_combine(), and gf2_matrix_square().

static int sum32Digest | ( | sum32Param * | mp,
|  | byte * | data |
| ) |  |  | `[static]`

Definition at line 108 of file digest.c.

References sum32Param::crc, and sum32Reset().

Referenced by rpmDigestInit().

static int sum32Reset | ( | register sum32Param * | mp | ) | `[static]`

Definition at line 88 of file digest.c.

References sum32Param::crc, and sum32Param::update.

Referenced by rpmDigestInit(), and sum32Digest().

static int sum32Update | ( | sum32Param * | mp,
|  | const byte * | data,
|  | size_t | size |
| ) |  |  | `[static]`

Definition at line 98 of file digest.c.

References sum32Param::crc, and sum32Param::update.

Referenced by rpmDigestInit().

static int sum64Digest | ( | sum64Param * | mp,
|  | byte * | data |
| ) |  |  | `[static]`

Definition at line 285 of file digest.c.

References sum64Param::crc, and sum64Reset().

Referenced by rpmDigestInit().

static int sum64Reset | ( | register sum64Param * | mp | ) | `[static]`

Definition at line 265 of file digest.c.

References sum64Param::crc, and sum64Param::update.

Referenced by rpmDigestInit(), and sum64Digest().

static int sum64Update | ( | sum64Param * | mp,
|  | const byte * | data,
|  | size_t | size |
| ) |  |  | `[static]`

Definition at line 275 of file digest.c.

References sum64Param::crc, and sum64Param::update.

Referenced by rpmDigestInit().