X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=gcrypt.c;h=926eb15f41ae479b167a0b9a694b972c6f88fcfd;hb=2830b9f881898aaec073d5ba19e33482e30190bd;hp=d11e94c7a902462e1aacbb407d98be66d8938772;hpb=e151dbb79eac16326585ec0a33cf48029f5f22f4;p=paraslash.git 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); +}