crypto: Assume blocksize is a power of 2

The check in the encode/decode path using full division has a
noticeable amount of overhead.  By asserting the blocksize is
a power of 2, we can reduce this check to a mask.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Richard Henderson 2020-08-28 10:05:08 -07:00 committed by Daniel P. Berrangé
parent ca04c3cf15
commit eba29771c0
4 changed files with 9 additions and 6 deletions

View file

@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
#include "qemu/host-utils.h"
#include "qapi/error.h"
#include "crypto/cipher.h"
#include "cipherpriv.h"