X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gcrypt.c;h=926eb15f41ae479b167a0b9a694b972c6f88fcfd;hp=d11e94c7a902462e1aacbb407d98be66d8938772;hb=32ffc06c0706f51c3f1dc436911836f1f9aa326e;hpb=26a0b7e457d1dd7e0e40d866d28de00c5d1cfa54 diff --git a/gcrypt.c b/gcrypt.c index d11e94c7..926eb15f 100644 --- 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); +}