---
name: "crypto_shash_setkey"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/crypto_shash_setkey"
---

# crypto\_shash\_setkey(9)

set key for message digest

## NAME

crypto\_shash\_setkey - set key for message digest

## SYNOPSIS

**int crypto\_shash\_setkey(struct crypto\_shash \*** *tfm***, const u8 \*** *key***, unsigned int** *keylen***);**

## ARGUMENTS

*tfm*

cipher handle

*key*

buffer holding the key

*keylen*

length of the key in bytes

## DESCRIPTION

The caller provided key is set for the keyed message digest cipher. The cipher handle must point to a keyed message digest cipher in order for this function to succeed.

## RETURN

0 if the setting of the key was successful; \< 0 if an error occurred

## AUTHORS

**Stephan Mueller** \<smueller@chronox.de\>

Author.

**Marek Vasut** \<marek@denx.de\>

Author.

## COPYRIGHT
