X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt_common.c;h=05d71de4076cee75a6c285acc5bc0334dfe1db17;hp=a2f682687928dd2cee0f603e98e56f1bf3c9534f;hb=96bd269d26af317ba985ad7eec7f75dec5d76bd7;hpb=e3272a316d113dd9c0c6f01f3087ab14f945e76b diff --git a/crypt_common.c b/crypt_common.c index a2f68268..05d71de4 100644 --- a/crypt_common.c +++ b/crypt_common.c @@ -247,16 +247,6 @@ int check_key_file(const char *file, bool private_key) return 1; } -/** - * Convert a hash value to ascii format. - * - * \param hash the hash value. - * \param asc Result pointer. - * - * \a asc must point to an area of at least 2 * \p HASH_SIZE + 1 bytes which - * will be filled by the function with the ascii representation of the hash - * value given by \a hash, and a terminating \p NULL byte. - */ void hash_to_asc(unsigned char *hash, char *asc) { int i; @@ -269,15 +259,6 @@ void hash_to_asc(unsigned char *hash, char *asc) asc[2 * HASH_SIZE] = '\0'; } -/** - * Compare two hashes. - * - * \param h1 Pointer to the first hash value. - * \param h2 Pointer to the second hash value. - * - * \return 1, -1, or zero, depending on whether \a h1 is greater than, - * less than or equal to h2, respectively. - */ int hash_compare(unsigned char *h1, unsigned char *h2) { int i; @@ -291,19 +272,6 @@ int hash_compare(unsigned char *h1, unsigned char *h2) return 0; } -/** - * Receive a buffer, decrypt it and write terminating NULL byte. - * - * \param scc The context. - * \param buf The buffer to write the decrypted data to. - * \param size The size of \a buf. - * - * Read at most \a size - 1 bytes from file descriptor given by \a scc, decrypt - * the received data and write a NULL byte at the end of the decrypted data. - * - * \return The return value of the underlying call to \ref - * sc_recv_bin_buffer(). - */ int sc_recv_buffer(struct stream_cipher_context *scc, char *buf, size_t size) { int n; @@ -317,27 +285,11 @@ int sc_recv_buffer(struct stream_cipher_context *scc, char *buf, size_t size) return n; } -/** - * Encrypt and send a \p NULL-terminated buffer. - * - * \param scc The context. - * \param buf The buffer to send. - * - * \return The return value of the underyling call to sc_send_bin_buffer(). - */ int sc_send_buffer(struct stream_cipher_context *scc, char *buf) { return sc_send_bin_buffer(scc, buf, strlen(buf)); } -/** - * Format, encrypt and send a buffer. - * - * \param scc The context. - * \param fmt A format string. - * - * \return The return value of the underyling call to sc_send_buffer(). - */ __printf_2_3 int sc_send_va_buffer(struct stream_cipher_context *scc, const char *fmt, ...) {