1 /*
2  * Common code for the PGP WDE format.
3  */
4 
5 #include <string.h>
6 
7 #include "formats.h"
8 #include "sha.h"
9 #include "aes.h"
10 
11 #define FORMAT_NAME             ""
12 #define FORMAT_TAG              "$pgpwde$"
13 #define FORMAT_TAG_LENGTH       (sizeof(FORMAT_TAG) - 1)
14 
15 struct custom_salt {
16 	int version;
17 	int symmAlg;
18 	int s2ktype;
19 	int hashIterations;
20 	int bytes;
21 	int salt_size;
22 	unsigned char salt[16];
23 	unsigned char esk[128];
24 };
25 
26 extern struct fmt_tests pgpwde_tests[];
27 
28 // exported 'common' functions
29 int pgpwde_valid(char *ciphertext, struct fmt_main *self);
30 void *pgpwde_get_salt(char *ciphertext);
31 int pgpwde_decrypt_and_verify(unsigned char *key, unsigned char *esk, int esklen);
32