home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / utilities / cli / pgp2 / src / h / crypto < prev    next >
Encoding:
Text File  |  1995-04-28  |  3.2 KB  |  99 lines

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