summaryrefslogtreecommitdiffstats
path: root/examples/pk.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-24 12:14:00 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-24 12:35:38 +0200
commit4b45720ea1dffc3514c81439c7f93928d05c5521 (patch)
tree17518795d5e965411b5c2c5ed787cf2c220d738e /examples/pk.c
parent951eda087f418c2a5ced189fa9d64c8616634dd0 (diff)
downloadcryptodev-linux-4b45720ea1dffc3514c81439c7f93928d05c5521.tar.gz
cryptodev-linux-4b45720ea1dffc3514c81439c7f93928d05c5521.tar.xz
cryptodev-linux-4b45720ea1dffc3514c81439c7f93928d05c5521.zip
Simplified the session_op structure and combined the OP_SIGN with the OP_DIGEST
for digest algorithms.
Diffstat (limited to 'examples/pk.c')
-rw-r--r--examples/pk.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/pk.c b/examples/pk.c
index fef695c..ce9dff8 100644
--- a/examples/pk.c
+++ b/examples/pk.c
@@ -371,8 +371,8 @@ static int rsa_key_encrypt(int cfd, ncr_key_t privkey, ncr_key_t pubkey, int oae
nop.init.params.params.rsa.type = RSA_PKCS1_V1_5;
}
nop.init.op = NCR_OP_ENCRYPT;
- nop.op.data.cipher.plaintext = datad;
- nop.op.data.cipher.ciphertext = encd;
+ nop.op.input = datad;
+ nop.op.output = encd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -391,8 +391,8 @@ static int rsa_key_encrypt(int cfd, ncr_key_t privkey, ncr_key_t pubkey, int oae
} else {
nop.init.params.params.rsa.type = RSA_PKCS1_V1_5;
}
- nop.op.data.cipher.plaintext = encd;
- nop.op.data.cipher.ciphertext = encd;
+ nop.op.input = encd;
+ nop.op.output = encd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -466,8 +466,8 @@ static int rsa_key_sign_verify(int cfd, ncr_key_t privkey, ncr_key_t pubkey, int
nop.init.params.params.rsa.sign_hash = NCR_ALG_SHA1;
nop.init.op = NCR_OP_SIGN;
- nop.op.data.sign.text = datad;
- nop.op.data.sign.output = signd;
+ nop.op.input = datad;
+ nop.op.output = signd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -483,8 +483,8 @@ static int rsa_key_sign_verify(int cfd, ncr_key_t privkey, ncr_key_t pubkey, int
nop.init.params.params.rsa.sign_hash = NCR_ALG_SHA1;
nop.init.op = NCR_OP_VERIFY;
- nop.op.data.verify.text = datad;
- nop.op.data.verify.signature = signd;
+ nop.op.input = datad;
+ nop.op.output = signd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -545,8 +545,8 @@ static int dsa_key_sign_verify(int cfd, ncr_key_t privkey, ncr_key_t pubkey)
nop.init.params.params.dsa.sign_hash = NCR_ALG_SHA1;
nop.init.op = NCR_OP_SIGN;
- nop.op.data.sign.text = datad;
- nop.op.data.sign.output = signd;
+ nop.op.input = datad;
+ nop.op.output = signd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -561,8 +561,8 @@ static int dsa_key_sign_verify(int cfd, ncr_key_t privkey, ncr_key_t pubkey)
nop.init.params.params.dsa.sign_hash = NCR_ALG_SHA1;
nop.init.op = NCR_OP_VERIFY;
- nop.op.data.verify.text = datad;
- nop.op.data.verify.signature = signd;
+ nop.op.input = datad;
+ nop.op.output = signd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);