rpm 4.18.0
rpmcrypto.h
Go to the documentation of this file.
1#ifndef _RPMCRYPTO_H
2#define _RPMCRYPTO_H
3
4#include <rpm/rpmtypes.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
12typedef struct DIGEST_CTX_s * DIGEST_CTX;
13typedef struct rpmDigestBundle_s * rpmDigestBundle;
14
19typedef enum rpmHashAlgo_e {
31
37};
38
40
48int rpmInitCrypto(void);
49
53int rpmFreeCrypto(void);
54
61
67size_t rpmDigestLength(int hashalgo);
68
77
85int rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len);
86
98int rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t * lenp, int asAscii);
99
105
112
122 rpmDigestFlags flags);
123
132int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id,
133 rpmDigestFlags flags);
134
142int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len);
143
155 void ** datap, size_t * lenp, int asAscii);
156
164
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* _RPMCRYPTO_H */
int rpmInitCrypto(void)
Perform cryptography initialization.
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
Free a digest bundle and all contained digest contexts.
rpmDigestFlags_e
Bit(s) to control digest operation.
Definition: rpmcrypto.h:35
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
Initialize digest.
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo, rpmDigestFlags flags)
Add a new type of digest to a bundle.
rpmHashAlgo_e
At this time these simply mirror PGPHASHALGO numbers.
Definition: rpmcrypto.h:19
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
Return digest and destroy context.
rpmDigestBundle rpmDigestBundleNew(void)
Create a new digest bundle.
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id, void **datap, size_t *lenp, int asAscii)
Return digest from a bundle and destroy context, see rpmDigestFinal().
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
Duplicate a digest context.
enum rpmHashAlgo_e rpmHashAlgo
At this time these simply mirror PGPHASHALGO numbers.
size_t rpmDigestLength(int hashalgo)
Obtain digest length in bytes.
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int id)
Duplicate a digest context from a bundle.
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
int rpmFreeCrypto(void)
Shutdown cryptography.
struct DIGEST_CTX_s * DIGEST_CTX
Definition: rpmcrypto.h:12
int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id, rpmDigestFlags flags)
Add a new type of digest to a bundle.
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
Update contexts within bundle with next plain text buffer.
@ RPMDIGEST_NONE
Definition: rpmcrypto.h:36
@ RPM_HASH_SHA256
Definition: rpmcrypto.h:26
@ RPM_HASH_SHA512
Definition: rpmcrypto.h:28
@ RPM_HASH_MD2
Definition: rpmcrypto.h:23
@ RPM_HASH_TIGER192
Definition: rpmcrypto.h:24
@ RPM_HASH_SHA224
Definition: rpmcrypto.h:29
@ RPM_HASH_HAVAL_5_160
Definition: rpmcrypto.h:25
@ RPM_HASH_RIPEMD160
Definition: rpmcrypto.h:22
@ RPM_HASH_SHA384
Definition: rpmcrypto.h:27
@ RPM_HASH_MD5
Definition: rpmcrypto.h:20
@ RPM_HASH_SHA1
Definition: rpmcrypto.h:21
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmFlags rpmDigestFlags
Definition: rpmcrypto.h:39
struct rpmDigestBundle_s * rpmDigestBundle
Definition: rpmcrypto.h:13
Typedefs for RPM abstract data types.