summaryrefslogtreecommitdiffstats
path: root/examples
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
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')
-rw-r--r--examples/ncr.c14
-rw-r--r--examples/pk.c24
-rw-r--r--examples/speed.c4
3 files changed, 21 insertions, 21 deletions
diff --git a/examples/ncr.c b/examples/ncr.c
index 234e8bd..d9870e0 100644
--- a/examples/ncr.c
+++ b/examples/ncr.c
@@ -809,8 +809,8 @@ test_ncr_aes(int cfd)
nop.init.algorithm = NCR_ALG_AES_ECB;
nop.init.key = key;
nop.init.op = NCR_OP_ENCRYPT;
- nop.op.data.cipher.plaintext = dd;
- nop.op.data.cipher.ciphertext = dd2;
+ nop.op.input = dd;
+ nop.op.output = dd2;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -884,8 +884,8 @@ test_ncr_aes(int cfd)
nop.init.algorithm = NCR_ALG_AES_ECB;
nop.init.key = key;
nop.init.op = NCR_OP_DECRYPT;
- nop.op.data.cipher.ciphertext = dd;
- nop.op.data.cipher.plaintext = dd2;
+ nop.op.input = dd;
+ nop.op.output = dd2;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
@@ -946,7 +946,7 @@ struct hash_vectors_st {
.plaintext_size = sizeof("what do ya want for nothing?")-1,
.output = (uint8_t*)"\x8f\x82\x03\x94\xf9\x53\x35\x18\x20\x45\xda\x24\xf3\x4d\xe5\x2b\xf8\xbc\x34\x32",
.output_size = 20,
- .op = NCR_OP_DIGEST,
+ .op = NCR_OP_SIGN,
},
{
.name = "HMAC-MD5",
@@ -1098,8 +1098,8 @@ test_ncr_hash(int cfd)
if (hash_vectors[i].key != NULL)
nop.init.key = key;
nop.init.op = hash_vectors[i].op;
- nop.op.data.sign.text = dd;
- nop.op.data.sign.output = dd2;
+ nop.op.input = dd;
+ nop.op.output = dd2;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);
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__);
diff --git a/examples/speed.c b/examples/speed.c
index 1c76eb6..d3cf04a 100644
--- a/examples/speed.c
+++ b/examples/speed.c
@@ -189,8 +189,8 @@ int encrypt_data_ncr(int cfd, int algo, int chunksize)
nop.init.algorithm = algo;
nop.init.key = key;
nop.init.op = NCR_OP_ENCRYPT;
- nop.op.data.cipher.plaintext = dd;
- nop.op.data.cipher.ciphertext = dd;
+ nop.op.input = dd;
+ nop.op.output = dd;
if (ioctl(cfd, NCRIO_SESSION_ONCE, &nop)) {
fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__);