diff options
author | David Howells <dhowells@redhat.com> | 2012-09-21 23:24:55 +0100 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-10-08 13:50:14 +1030 |
commit | 00f56d3e492994b0bef5378c94711d2df1097df9 (patch) | |
tree | 1c2e16480a17f2b15bc449c2533b2b08b7045bb2 /crypto/asymmetric_keys/public_key.h | |
parent | 0d71c37dbd07235cf1c9d34b38de7f4ac6107cb1 (diff) | |
download | linux-crypto-00f56d3e492994b0bef5378c94711d2df1097df9.tar.gz linux-crypto-00f56d3e492994b0bef5378c94711d2df1097df9.zip |
KEYS: Asymmetric public-key algorithm crypto key subtype
Add a subtype for supporting asymmetric public-key encryption algorithms such
as DSA (FIPS-186) and RSA (PKCS#1 / RFC1337).
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'crypto/asymmetric_keys/public_key.h')
-rw-r--r-- | crypto/asymmetric_keys/public_key.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/public_key.h b/crypto/asymmetric_keys/public_key.h new file mode 100644 index 00000000..1f86aad3 --- /dev/null +++ b/crypto/asymmetric_keys/public_key.h @@ -0,0 +1,28 @@ +/* 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); +}; |