diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -511,6 +511,8 @@ 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 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -449,6 +449,9 @@ 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 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1177,6 +1177,7 @@ 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 --- 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_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 --- a/sys/opencrypto/xform_rmd160.c +++ b/sys/opencrypto/xform_rmd160.c @@ -57,6 +57,18 @@ 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, diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -168,6 +168,8 @@ const EVP_MD *(*evp_md)(void); int pkey; } algs[] = { + { .name = "ripemd160", .mac = CRYPTO_RIPEMD160, .type = T_HASH, + .evp_md = EVP_ripemd160 }, { .name = "sha1", .mac = CRYPTO_SHA1, .type = T_HASH, .evp_md = EVP_sha1 }, { .name = "sha224", .mac = CRYPTO_SHA2_224, .type = T_HASH,