PostgreSQL Source Code: contrib/pgcrypto/pgp.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

33

35#include "px.h"

36

38{

42};

43

45{

64};

65

67{

73};

74

76{

88};

89

91{

96};

97

99{

110};

111

112#define PGP_MAX_KEY (256/8)

113#define PGP_MAX_BLOCK (256/8)

114#define PGP_MAX_DIGEST (512/8)

115#define PGP_S2K_SALT 8

116

121

123{

128

131};

132

133

135{

136

137

138

152

153

154

155

163

167

168

169

170

173};

174

175

176#define s2k_decode_count(cval) \

177 (((unsigned) 16 + (cval & 15)) << ((cval >> 4) + 6))

178

180{

184};

185

187{

191

192

193 union

194 {

195 struct

196 {

201 struct

202 {

206 struct

207 {

214

215

216 union

217 {

218 struct

219 {

222 struct

223 {

229 struct

230 {

234

237};

238

243

247

261

264 const uint8 *key, int key_len, int pubtype);

265

267

268

269

274

278

285

287 int num_headers, char **keys, char **values);

290 int *nheaders, char ***keys, char ***values);

291

294

298

303 int allow_ctx);

304

307

310

318

325

static Datum values[MAXATTR]

static PgChecksumMode mode

int pgp_disable_mdc(PGP_Context *ctx, int disable)

int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p)

int pgp_extract_armor_headers(const uint8 *src, unsigned len, int *nheaders, char ***keys, char ***values)

int pgp_get_cipher_code(const char *name)

int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int key_len)

int pgp_mpi_create(uint8 *data, int bits, PGP_MPI **mpi)

int pgp_cfb_encrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)

int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c1_p, PGP_MPI **c2_p)

int pgp_init(PGP_Context **ctx_p)

int pgp_decrypt(PGP_Context *ctx, MBuf *msrc, MBuf *mdst)

int pgp_set_text_mode(PGP_Context *ctx, int mode)

int pgp_set_s2k_digest_algo(PGP_Context *ctx, const char *name)

const char * pgp_get_digest_name(int code)

void pgp_cfb_free(PGP_CFB *ctx)

int pgp_set_s2k_mode(PGP_Context *ctx, int mode)

int pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst)

@ PGP_PKT_SYMENCRYPTED_DATA

@ PGP_PKT_COMPRESSED_DATA

@ PGP_PKT_SYMENCRYPTED_SESSKEY

@ PGP_PKT_SYMENCRYPTED_DATA_MDC

@ PGP_PKT_PUBENCRYPTED_SESSKEY

int pgp_get_digest_code(const char *name)

int pgp_key_alloc(PGP_PubKey **pk_p)

int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2, PGP_MPI **msg_p)

int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int len)

int pgp_armor_decode(const uint8 *src, int len, StringInfo dst)

int pgp_mpi_alloc(int bits, PGP_MPI **mpi)

int pgp_s2k_fill(PGP_S2K *s2k, int mode, int digest_algo, int count)

int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p, int allow_ctx)

int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k)

int pgp_expect_packet_end(PullFilter *pkt)

int pgp_mpi_free(PGP_MPI *mpi)

int pgp_get_cipher_block_size(int code)

int pgp_write_pubenc_sesskey(PGP_Context *ctx, PushFilter *dst)

int pgp_cfb_decrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)

int pgp_load_cipher(int code, PX_Cipher **res)

void pgp_key_free(PGP_PubKey *pk)

int pgp_mpi_write(PushFilter *dst, PGP_MPI *n)

int pgp_set_s2k_cipher_algo(PGP_Context *ctx, const char *name)

int pgp_mpi_hash(PX_MD *md, PGP_MPI *n)

int pgp_set_compress_algo(PGP_Context *ctx, int algo)

void pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst, int num_headers, char **keys, char **values)

int pgp_get_unicode_mode(PGP_Context *ctx)

int pgp_parse_pubenc_sesskey(PGP_Context *ctx, PullFilter *pkt)

int pgp_set_cipher_algo(PGP_Context *ctx, const char *name)

int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt, const uint8 *key, int key_len, int pubtype)

int pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src)

int pgp_encrypt(PGP_Context *ctx, MBuf *src, MBuf *dst)

@ PGP_PUB_RSA_ENCRYPT_SIGN

int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p)

int pgp_set_convert_crlf(PGP_Context *ctx, int doit)

int pgp_set_unicode_mode(PGP_Context *ctx, int mode)

int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p)

int pgp_get_keyid(MBuf *pgp_data, char *dst)

struct PullFilterOps pgp_decrypt_filter

int pgp_skip_packet(PullFilter *pkt)

int pgp_mpi_read(PullFilter *src, PGP_MPI **mpi)

unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n)

int pgp_get_cipher_key_size(int code)

int pgp_free(PGP_Context *ctx)

int pgp_cfb_create(PGP_CFB **ctx_p, int algo, const uint8 *key, int key_len, int resync, uint8 *iv)

int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len, int pkttype, PGP_Context *ctx)

int pgp_set_s2k_count(PGP_Context *ctx, int count)

int pgp_create_pkt_writer(PushFilter *dst, int tag, PushFilter **res_p)

int pgp_set_sess_key(PGP_Context *ctx, int use)

int pgp_load_digest(int code, PX_MD **res)

int pgp_set_compress_level(PGP_Context *ctx, int level)

uint8 sess_key[PGP_MAX_KEY]

struct PGP_PubKey::@0::@3 rsa

struct PGP_PubKey::@0::@2 elg

struct PGP_PubKey::@0::@4 dsa