aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/crypto_test.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2021-05-03 15:29:56 +0000
committerDamjan Marion <dmarion@me.com>2021-05-05 07:34:00 +0000
commit06111a837d77323d253ecfd26557775fa0b03ca8 (patch)
treed41200c0d91d01894b6caaa82e03c2f86c5800b2 /src/plugins/unittest/crypto_test.c
parent9592909ecc1522cf36d4701f998b6f03c738e319 (diff)
crypto crypto-openssl: support hashing operations
Type: feature Change-Id: I36041fe5c5f0ff129aee42516189807e96f62123 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/unittest/crypto_test.c')
-rw-r--r--src/plugins/unittest/crypto_test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/unittest/crypto_test.c b/src/plugins/unittest/crypto_test.c
index f08b253dd19..ed21e86b8d7 100644
--- a/src/plugins/unittest/crypto_test.c
+++ b/src/plugins/unittest/crypto_test.c
@@ -75,6 +75,9 @@ print_results (vlib_main_t * vm, unittest_crypto_test_registration_t ** rv,
case VNET_CRYPTO_OP_TYPE_HMAC:
exp_digest = &r->digest;
break;
+ case VNET_CRYPTO_OP_TYPE_HASH:
+ exp_digest = &r->digest;
+ break;
default:
ASSERT (0);
}
@@ -629,6 +632,12 @@ test_crypto_static (vlib_main_t * vm, crypto_test_main_t * tm,
op->len = r->plaintext.length;
}
break;
+ case VNET_CRYPTO_OP_TYPE_HASH:
+ op->digest = computed_data + computed_data_total_len;
+ computed_data_total_len += r->digest.length;
+ op->src = r->plaintext.data;
+ op->len = r->plaintext.length;
+ break;
default:
break;
};
@@ -802,6 +811,10 @@ test_crypto (vlib_main_t * vm, crypto_test_main_t * tm)
n_ops_static += 1;
}
break;
+ case VNET_CRYPTO_OP_TYPE_HASH:
+ computed_data_total_len += r->digest.length;
+ n_ops_static += 1;
+ break;
default:
break;
};