aboutsummaryrefslogtreecommitdiff
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-12-30 00:46:48 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-12-30 00:46:48 +0000
commitc3a688ef4dcb6566dc57fdaf816445ac2dc30f0e (patch)
tree1742f782b326872bf511b7a298c2f0fcfe4cb4da /sys/opencrypto
parentb406897911ea6c18c401907a076c4642dac46127 (diff)
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c2
-rw-r--r--sys/opencrypto/cryptodev.c3
-rw-r--r--sys/opencrypto/cryptosoft.c1
-rw-r--r--sys/opencrypto/xform_auth.h1
-rw-r--r--sys/opencrypto/xform_rmd160.c12
5 files changed, 19 insertions, 0 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index d1b627df8232..0ddde1e50899 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -511,6 +511,8 @@ crypto_auth_hash(const struct crypto_session_params *csp)
return (&auth_hash_null);
case CRYPTO_RIPEMD160_HMAC:
return (&auth_hash_hmac_ripemd_160);
+ case CRYPTO_RIPEMD160:
+ return (&auth_hash_ripemd_160);
case CRYPTO_SHA1:
return (&auth_hash_sha1);
case CRYPTO_SHA2_224:
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index d8a5f4116876..6e943735242d 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -449,6 +449,9 @@ cse_create(struct fcrypt *fcr, struct session2_op *sop)
return (EINVAL);
}
break;
+ case CRYPTO_RIPEMD160:
+ thash = &auth_hash_ripemd_160;
+ break;
case CRYPTO_SHA1:
thash = &auth_hash_sha1;
break;
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index 430c8c12bf1e..43fefae99c40 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -1177,6 +1177,7 @@ swcr_setup_auth(struct swcr_session *ses,
csp->csp_auth_klen, swa->sw_octx);
}
break;
+ case CRYPTO_RIPEMD160:
case CRYPTO_SHA1:
case CRYPTO_SHA2_224:
case CRYPTO_SHA2_256:
diff --git a/sys/opencrypto/xform_auth.h b/sys/opencrypto/xform_auth.h
index b5fd2efdb3b4..859e451fcc0d 100644
--- a/sys/opencrypto/xform_auth.h
+++ b/sys/opencrypto/xform_auth.h
@@ -70,6 +70,7 @@ extern const struct auth_hash auth_hash_hmac_sha2_224;
extern const struct auth_hash auth_hash_hmac_sha2_256;
extern const struct auth_hash auth_hash_hmac_sha2_384;
extern const struct auth_hash auth_hash_hmac_sha2_512;
+extern const struct auth_hash auth_hash_ripemd_160;
extern const struct auth_hash auth_hash_sha1;
extern const struct auth_hash auth_hash_sha2_224;
extern const struct auth_hash auth_hash_sha2_256;
diff --git a/sys/opencrypto/xform_rmd160.c b/sys/opencrypto/xform_rmd160.c
index 8480a63d12dc..4814fe8d67b3 100644
--- a/sys/opencrypto/xform_rmd160.c
+++ b/sys/opencrypto/xform_rmd160.c
@@ -57,6 +57,18 @@ static void RMD160Init_int(void *);
static int RMD160Update_int(void *, const void *, u_int);
static void RMD160Final_int(uint8_t *, void *);
+/* Plain hash */
+const struct auth_hash auth_hash_ripemd_160 = {
+ .type = CRYPTO_RIPEMD160,
+ .name = "RIPEMD-160",
+ .hashsize = RIPEMD160_HASH_LEN,
+ .ctxsize = sizeof(RMD160_CTX),
+ .blocksize = RIPEMD160_BLOCK_LEN,
+ .Init = RMD160Init_int,
+ .Update = RMD160Update_int,
+ .Final = RMD160Final_int,
+};
+
/* Authentication instances */
const struct auth_hash auth_hash_hmac_ripemd_160 = {
.type = CRYPTO_RIPEMD160_HMAC,