X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt.h;h=b963d1055894fa2a5919db7c6bd3b49b19ed878c;hp=13a5505c9f56336ac6db43ab91fbbb65f965c065;hb=e4db7671a91a7552c642acc979f0eb278f8d467f;hpb=c387b216b5fd3c944053e1bba024815719e9a0d9 diff --git a/crypt.h b/crypt.h index 13a5505c..b963d105 100644 --- a/crypt.h +++ b/crypt.h @@ -30,7 +30,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 +39,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