summaryrefslogtreecommitdiff
path: root/cipher
diff options
context:
space:
mode:
Diffstat (limited to 'cipher')
-rw-r--r--cipher/cipher-poly1305.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cipher/cipher-poly1305.c b/cipher/cipher-poly1305.c
index 5cd3561b..0fd3e4e0 100644
--- a/cipher/cipher-poly1305.c
+++ b/cipher/cipher-poly1305.c
@@ -164,10 +164,12 @@ _gcry_cipher_poly1305_encrypt (gcry_cipher_hd_t c,
return GPG_ERR_INV_LENGTH;
}
+#ifdef USE_CHACHA20
if (LIKELY(inbuflen > 0) && LIKELY(c->spec->algo == GCRY_CIPHER_CHACHA20))
{
return _gcry_chacha20_poly1305_encrypt (c, outbuf, inbuf, inbuflen);
}
+#endif
while (inbuflen)
{
@@ -224,10 +226,12 @@ _gcry_cipher_poly1305_decrypt (gcry_cipher_hd_t c,
return GPG_ERR_INV_LENGTH;
}
+#ifdef USE_CHACHA20
if (LIKELY(inbuflen > 0) && LIKELY(c->spec->algo == GCRY_CIPHER_CHACHA20))
{
return _gcry_chacha20_poly1305_decrypt (c, outbuf, inbuf, inbuflen);
}
+#endif
while (inbuflen)
{