]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gcrypt.c
Use sideband also for challenge response.
[paraslash.git] / gcrypt.c
index d11e94c7a902462e1aacbb407d98be66d8938772..926eb15f41ae479b167a0b9a694b972c6f88fcfd 100644 (file)
--- a/gcrypt.c
+++ b/gcrypt.c
@@ -972,3 +972,15 @@ int sc_recv_bin_buffer(struct stream_cipher_context *scc, char *buf,
        assert(gret == 0);
        return ret;
 }
+
+void sc_crypt(struct stream_cipher *sc, struct iovec *src, struct iovec *dst)
+{
+       gcry_cipher_hd_t handle = sc->handle;
+       gcry_error_t gret;
+
+       /* perform in-place encryption */
+       *dst = *src;
+       gret = gcry_cipher_encrypt(handle, src->iov_base, src->iov_len,
+               NULL, 0);
+       assert(gret == 0);
+}