X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fgcrypt%2Fcipher.c;h=71add007dbd543bec79dce6bf2dda2167ace9d33;hb=d82fcc88f355e3c8144478a860dfae0b299004a9;hp=e1f1e057463977c13bd4b5af6a411fdcf5081593;hpb=1b8f8918360b40a2749d40355266ed7dedbe41b5;p=tinc diff --git a/src/gcrypt/cipher.c b/src/gcrypt/cipher.c index e1f1e057..71add007 100644 --- a/src/gcrypt/cipher.c +++ b/src/gcrypt/cipher.c @@ -173,7 +173,7 @@ bool cipher_set_key(cipher_t *cipher, void *key, bool encrypt) { return true; } -bool cipher_set_key(cipher_t *cipher, void *key, size_t len, bool encrypt) { +bool cipher_set_key_from_rsa(cipher_t *cipher, void *key, size_t len, bool encrypt) { memcpy(cipher->key, key + len - cipher->keylen, cipher->keylen + cipher->blklen); memcpy(cipher->key + cipher->keylen, key + len - cipher->keylen - cipher->blklen, cipher->blklen); @@ -227,7 +227,7 @@ static bool cipher_remove_padding(cipher_t *cipher, void *indata, size_t inlen, return true; } -bool cipher_encrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) { +bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) { gcry_error_t err; // To be fixed @@ -240,7 +240,7 @@ bool cipher_encrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata, return true; } -bool cipher_decrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) { +bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) { gcry_error_t err; // To be fixed