summaryrefslogtreecommitdiffstats
path: root/userspace/ncrypto_params.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-06 02:21:53 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-24 20:58:32 +0200
commit9c1054f1e24af545bdb1b88834482937253364eb (patch)
tree910e10490b446750619d3b0d4286d159256b8771 /userspace/ncrypto_params.c
parent73cf9125fae0d3873095d9faee178c7a9c04ec90 (diff)
downloadcryptodev-linux-9c1054f1e24af545bdb1b88834482937253364eb.tar.gz
cryptodev-linux-9c1054f1e24af545bdb1b88834482937253364eb.tar.xz
cryptodev-linux-9c1054f1e24af545bdb1b88834482937253364eb.zip
Add remaining accessors for ncr_key_params_t
Diffstat (limited to 'userspace/ncrypto_params.c')
-rw-r--r--userspace/ncrypto_params.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/userspace/ncrypto_params.c b/userspace/ncrypto_params.c
index 253664b..f5385f4 100644
--- a/userspace/ncrypto_params.c
+++ b/userspace/ncrypto_params.c
@@ -58,3 +58,61 @@ ncr_key_params_set_dh_pub(ncr_key_params_t params, void *pub, size_t pub_size)
return 0;
}
+int
+ncr_key_params_set_rsa_type(ncr_key_params_t params, ncr_rsa_type_t type)
+{
+ if (!params) {
+ errno = EINVAL;
+ return -1;
+ }
+ params->params.rsa.type = type;
+ return 0;
+}
+
+int
+ncr_key_params_set_rsa_oaep_hash(ncr_key_params_t params,
+ ncr_algorithm_t oaep_hash)
+{
+ if (!params) {
+ errno = EINVAL;
+ return -1;
+ }
+ params->params.rsa.oaep_hash = oaep_hash;
+ return 0;
+}
+
+int
+ncr_key_params_set_rsa_sign_hash(ncr_key_params_t params,
+ ncr_algorithm_t sign_hash)
+{
+ if (!params) {
+ errno = EINVAL;
+ return -1;
+ }
+ params->params.rsa.sign_hash = sign_hash;
+ return 0;
+}
+
+int
+ncr_key_params_set_rsa_pss_salt(ncr_key_params_t params, unsigned int pss_salt)
+{
+ if (!params) {
+ errno = EINVAL;
+ return -1;
+ }
+ params->params.rsa.pss_salt = pss_salt;
+ return 0;
+}
+
+int
+ncr_key_params_set_dsa_sign_hash(ncr_key_params_t params,
+ ncr_algorithm_t sign_hash)
+{
+ if (!params) {
+ errno = EINVAL;
+ return -1;
+ }
+ params->params.dsa.sign_hash = sign_hash;
+ return 0;
+}
+