summaryrefslogtreecommitdiffstats
path: root/ncr-pk.h
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-09-06 20:40:43 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-06 23:15:24 +0200
commit95496890180536231adfb983dc67c629f26f0caf (patch)
treed0cdb577dac177d42d2e048fe75544679c8a2d20 /ncr-pk.h
parenta92443718f19ffc36fbe55d85a4785130a4b33c7 (diff)
downloadcryptodev-linux-95496890180536231adfb983dc67c629f26f0caf.tar.gz
cryptodev-linux-95496890180536231adfb983dc67c629f26f0caf.tar.xz
cryptodev-linux-95496890180536231adfb983dc67c629f26f0caf.zip
Rename CONFIG_AS*YM*METRIC, push into headers
Diffstat (limited to 'ncr-pk.h')
-rw-r--r--ncr-pk.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/ncr-pk.h b/ncr-pk.h
index c8d61cb..65ca932 100644
--- a/ncr-pk.h
+++ b/ncr-pk.h
@@ -4,7 +4,9 @@
#include <tomcrypt.h>
struct nlattr;
+struct key_item_st;
+#ifdef CONFIG_CRYPTO_USERSPACE_ASYMMETRIC
struct ncr_pk_ctx {
const struct algo_properties_st *algorithm; /* algorithm */
@@ -59,4 +61,18 @@ int ncr_pk_derive(struct key_item_st *newkey, struct key_item_st *oldkey,
int ncr_pk_get_rsa_size(rsa_key * key);
int ncr_pk_get_dsa_size(dsa_key * key);
+#else /* !CONFIG_CRYPTO_USERSPACE_ASYMMETRIC */
+struct ncr_pk_ctx {};
+#define ncr_pk_clear(key) ((void)0)
+#define ncr_pk_pack(key, packed, packed_size) (-EOPNOTSUPP)
+#define ncr_pk_unpack(key, packed, packed_size) (-EOPNOTSUPP)
+#define ncr_pk_cipher_init(algo, ctx, tb, key, sign_hash) (-EOPNOTSUPP)
+#define ncr_pk_cipher_deinit(ctx) ((void)0)
+#define ncr_pk_cipher_encrypt(ctx, i, icnt, isize, o, ocnt, osize) (-EOPNOTSUPP)
+#define ncr_pk_cipher_decrypt(ctx, i, icnt, isize, o, ocnt, osize) (-EOPNOTSUPP)
+#define ncr_pk_cipher_sign(ctx, hash, hash_size, sig, sig_size) (-EOPNOTSUPP)
+#define ncr_pk_cipher_verify(ctx, sig, sig_size, hash, hash_size) (-EOPNOTSUPP)
+#define ncr_pk_derive(newkey, oldkey, tb) (-EOPNOTSUPP)
+#endif /* !CONFIG_CRYPTO_USERSPACE_ASYMMETRIC */
+
#endif