|
|
1.1.1.7 ! root 1: /* crypto.h - C headers for crypto.c ! 2: */ ! 3: ! 4: #include "idea.h" /* Declaration of IdeaCfbContext */ ! 5: ! 6: /* Used to determine if nesting should be allowed */ ! 7: boolean legal_ctb(byte ctb); ! 8: ! 9: /* Write an RSA-signed message digest of input file to specified output ! 10: file, and append input file to output file */ ! 11: int signfile(boolean nested, boolean separate_signature, char *mcguffin, ! 12: char *infile, char *outfile, char lit_mode, char *literalfile); ! 13: ! 14: /* Reads the first count bytes from infile into header */ ! 15: int get_header_info_from_file(char *infile, byte * header, int count); ! 16: ! 17: /* RSA-encrypt a file */ ! 18: int encryptfile(char **mcguffin, char *infile, char *outfile, ! 19: boolean attempt_compression); ! 20: ! 21: /* Encrypt file with IPES/IDEA cipher */ ! 22: int idea_encryptfile(char *infile, char *outfile, ! 23: boolean attempt_compression); ! 24: ! 25: /* Prepend a CTB_LITERAL prefix to a file */ ! 26: int make_literal(char *infile, char *outfile, char lit_mode, ! 27: char *literalfile); ! 28: ! 29: /* Decrypt a file (RSA or IPES/IDEA) */ ! 30: int decryptfile(char *infile, char *outfile); ! 31: ! 32: /* Check signature in infile for validity. Strip off the signature and ! 33: write the remaining packet to outfile */ ! 34: int check_signaturefile(char *infile, char *outfile, boolean strip_signature, ! 35: char *preserved_name); ! 36: ! 37: /* Decrypt file with IPES/IDEA only */ ! 38: int idea_decryptfile(char *infile, char *outfile); ! 39: ! 40: /* Decompress a file with ZIP algorithm */ ! 41: int decompress_file(char *infile, char *outfile); ! 42: ! 43: /* Strip off literal prefix from infile, copying to outfile */ ! 44: int strip_literal(char *infile, char *outfile, char *preserved_name, ! 45: char *lit_mode); ! 46: ! 47: #ifdef _VMS_VAXC ! 48: void write_mpi(); ! 49: int read_mpi(); ! 50: #else ! 51: ! 52: /* Write a multiprecision integer to a file */ ! 53: void write_mpi(unitptr n, FILE * f, struct IdeaCfbContext *cfb); ! 54: ! 55: /* Read a multiprecision integer from a file */ ! 56: int read_mpi(unitptr r, FILE * f, boolean adjust_precision, ! 57: struct IdeaCfbContext *cfb); ! 58: #endif ! 59: ! 60: /* Convert C <-> Quiche strings */ ! 61: void CToPascal(char *s); ! 62: void PascalToC(char *s); ! 63: ! 64: /* Tests if a randseed.bin file exists already */ ! 65: int seedfile_exists(void); ! 66: ! 67: /* Creates a randseed.bin file (call if above returns false) */ ! 68: void create_seedfile(void); ! 69: ! 70: /* Return date string, given pointer to 32-bit timestamp */ ! 71: char *cdate(word32 * tstamp); ! 72: ! 73: /* Return date and time string, given pointer to 32-bit timestamp */ ! 74: char *ctdate(word32 * tstamp); ! 75: ! 76: /* Return current timestamp as a byte array and as a 32-bit word */ ! 77: word32 get_timestamp(byte * timestamp); ! 78: ! 79: /* Returns the length of a packet according to the CTB and the ! 80: length field */ ! 81: word32 getpastlength(byte ctb, FILE * f); ! 82: ! 83: /* Write a CTB with the appropriate length field */ ! 84: void write_ctb_len(FILE * f, byte ctb_type, word32 length, boolean big); ! 85: ! 86: /* Print an error message and return nonzero if val != checkval */ ! 87: int version_error(int val, int checkval); ! 88: /* The same, if val is not a recognized version */ ! 89: int version_byte_error(int val); ! 90: ! 91: int check_key_sig(FILE * fkey, long fpkey, int keypktlen, char *keyuserid, ! 92: FILE * fsig, long fpsig, char *keyfile, char *siguserid, ! 93: byte * xtimestamp, ! 94: byte * sigclass); ! 95: ! 96: int squish_file(char *infile, char *outfile); ! 97: ! 98: int do_sign(char *keyfile, long fp, int pktlen, byte *userid, byte *keyID, ! 99: char *sigguffin, boolean batchmode); ! 100: ! 101: int signkey(char *keyguffin, char *sigguffin, char *keyfile); ! 102: ! 103: extern int compromise(byte * keyID, char *keyfile); ! 104: ! 105: void showKeyHash(unitptr n, unitptr e); ! 106: int GetHashedPassPhrase(char *hash, boolean noecho);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.