]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - crypt.h
Remove rc4.h.
[paraslash.git] / crypt.h
diff --git a/crypt.h b/crypt.h
index 13a5505c9f56336ac6db43ab91fbbb65f965c065..0e0695e574ecbfcb6dd4c5491fa2f499329a8d14 100644 (file)
--- a/crypt.h
+++ b/crypt.h
@@ -20,8 +20,12 @@ void free_asymmetric_key(struct asymmetric_key *key);
 void get_random_bytes_or_die(unsigned char *buf, int num);
 void init_random_seed_or_die(void);
 
+/** Opaque structure for stream cipher crypto. */
 struct stream_cipher;
 
+/** Number of bytes of the session key. */
+#define SESSION_KEY_LEN 32
+
 /**
  * Used on the server-side for client-server communication encryption.
  *
@@ -30,7 +34,7 @@ struct stream_cipher;
  * keys for the stream cipher and the file descriptor for which these keys
  * should be used.
  */
-struct rc4_context {
+struct stream_cipher_context {
        /** The socket file descriptor. */
        int fd;
        /** Key used for receiving data. */
@@ -39,14 +43,17 @@ struct rc4_context {
        struct stream_cipher *send;
 };
 
-struct stream_cipher *stream_cipher_new(const unsigned char *data, int len);
-void stream_cipher_free(struct stream_cipher *sc);
-
-int rc4_send_bin_buffer(struct rc4_context *rc4c, const char *buf, size_t len);
-int rc4_send_buffer(struct rc4_context *rc4c, const char *buf);
-__printf_2_3 int rc4_send_va_buffer(struct rc4_context *rc4c, const char *fmt, ...);
-int rc4_recv_bin_buffer(struct rc4_context *rcc, char *buf, size_t size);
-int rc4_recv_buffer(struct rc4_context *rcc, char *buf, size_t size);
+struct stream_cipher *sc_new(const unsigned char *data, int len);
+void sc_free(struct stream_cipher *sc);
+
+int sc_send_bin_buffer(struct stream_cipher_context *scc, const char *buf,
+               size_t len);
+int sc_send_buffer(struct stream_cipher_context *scc, const char *buf);
+__printf_2_3 int sc_send_va_buffer(struct stream_cipher_context *scc,
+               const char *fmt, ...);
+int sc_recv_bin_buffer(struct stream_cipher_context *scc, char *buf,
+               size_t size);
+int sc_recv_buffer(struct stream_cipher_context *scc, char *buf, size_t size);
 
 /** \cond used to distinguish between loading of private/public key */
 #define LOAD_PUBLIC_KEY 0