Low level ops?
R0b0t1
r030t1 at gmail.com
Sun Jun 10 17:55:04 CEST 2018
On Sun, Jun 10, 2018 at 4:25 AM, Stef Bon <stefbon at gmail.com> wrote:
> Hi,
>
> I've got a ssh client to access sftp via fuse.
> Now I'm working on making parallel encryption and decryption work. I
> hope I can achieve some performance improvements.
>
> Now I'm asking whether "low level" function calls in gcrypt can make
> things run faster. Let me explain what I mean. When I look at
> cipher-cbc to the function to encrypt en decrypt. These functions
> check first the blocksize and the buffer (and both). These checks are
> done over and over again, for every message. Does it slow things a
> bit? If so it may be worth the effort to create encrypt/decrypt calls
> whithout these checks. In my application the length of the ouputbuffer
> is always equal to the length of the inputbuffer. And the blocksize is
> always the default blocksize for the cipher. And in ssh the input
> buffer length is always is multiple of the blocksize (padding is
> done).
>
> It's also possibe that these checks do not cost anything. I don't know.
>
You may want to look at
https://panthema.net/2008/0714-cryptography-speedtest-comparison/.
>From memory, the conclusion is "don't use gcrypt."
But yes, the change you are describing could save some time. A few
libraries offer two API functions - one which is a wrapper, and then
one which does not wrap the algorithm at all, should you always supply
compliant input.
Cheers,
R0b0t1
More information about the Gcrypt-devel
mailing list