summaryrefslogtreecommitdiffstats
path: root/crypto/asymmetric_keys/public_key.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-02-09 16:18:01 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-02-09 16:18:01 +0800
commitf75516a81548074be331b3e41d2e3f448d1f8b8d (patch)
treeba6e557c7473389709cf7a3bc69e608dcd8584f2 /crypto/asymmetric_keys/public_key.h
parented1afac9145c4517a2c84f93e04a35046ea206e3 (diff)
downloadop-kernel-dev-f75516a81548074be331b3e41d2e3f448d1f8b8d.zip
op-kernel-dev-f75516a81548074be331b3e41d2e3f448d1f8b8d.tar.gz
crypto: keys - Revert "convert public key to akcipher api"
This needs to go through the security tree so I'm reverting the patches for now. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/asymmetric_keys/public_key.h')
-rw-r--r--crypto/asymmetric_keys/public_key.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/public_key.h b/crypto/asymmetric_keys/public_key.h
new file mode 100644
index 0000000..5c37a22
--- /dev/null
+++ b/crypto/asymmetric_keys/public_key.h
@@ -0,0 +1,36 @@
+/* Public key algorithm internals
+ *
+ * See Documentation/crypto/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <crypto/public_key.h>
+
+extern struct asymmetric_key_subtype public_key_subtype;
+
+/*
+ * Public key algorithm definition.
+ */
+struct public_key_algorithm {
+ const char *name;
+ u8 n_pub_mpi; /* Number of MPIs in public key */
+ u8 n_sec_mpi; /* Number of MPIs in secret key */
+ u8 n_sig_mpi; /* Number of MPIs in a signature */
+ int (*verify_signature)(const struct public_key *key,
+ const struct public_key_signature *sig);
+};
+
+extern const struct public_key_algorithm RSA_public_key_algorithm;
+
+/*
+ * public_key.c
+ */
+extern int public_key_verify_signature(const struct public_key *pk,
+ const struct public_key_signature *sig);
OpenPOWER on IntegriCloud