summaryrefslogtreecommitdiff
path: root/cipher/cipher.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2014-06-06 22:48:30 +0400
committerWerner Koch <wk@gnupg.org>2014-06-28 10:41:10 +0200
commitfb074d113fcbf66a5c20592625cb19051f3430f5 (patch)
tree04661fe7f31460c8e8aac7e9c97fee2ff64b5e64 /cipher/cipher.c
parent164738a0292b3f32c7747099ad9cadace58e5eda (diff)
downloadlibgcrypt-fb074d113fcbf66a5c20592625cb19051f3430f5.tar.gz
Support setting s-box for the ciphers that require it
* src/gcrypt.h.in (GCRYCTL_SET_SBOX, gcry_cipher_set_sbox): New. * cipher/cipher.c (_gcry_cipher_ctl): pass GCRYCTL_SET_SBOX to set_extra_info callback. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r--cipher/cipher.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c
index da590610..5c44c0d9 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -1264,6 +1264,13 @@ _gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer, size_t buflen)
}
break;
+ case GCRYCTL_SET_SBOX:
+ if (h->spec->set_extra_info)
+ rc = h->spec->set_extra_info
+ (&h->context.c, GCRYCTL_SET_SBOX, buffer, buflen);
+ else
+ rc = GPG_ERR_NOT_SUPPORTED;
+
default:
rc = GPG_ERR_INV_OP;
}