'\" t .\" Title: crypto_skcipher_setkey .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Programming Interface .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "CRYPTO_SKCIPHER_SETK" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Programming Interface" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" crypto_skcipher_setkey \- set key for cipher .SH "SYNOPSIS" .HP \w'int\ crypto_skcipher_setkey('u .BI "int crypto_skcipher_setkey(struct\ crypto_skcipher\ *\ " "tfm" ", const\ u8\ *\ " "key" ", unsigned\ int\ " "keylen" ");" .SH "ARGUMENTS" .PP \fItfm\fR .RS 4 cipher handle .RE .PP \fIkey\fR .RS 4 buffer holding the key .RE .PP \fIkeylen\fR .RS 4 length of the key in bytes .RE .SH "DESCRIPTION" .PP The caller provided key is set for the skcipher referenced by the cipher handle\&. .PP Note, the key length determines the cipher type\&. Many block ciphers implement different cipher modes depending on the key size, such as AES\-128 vs AES\-192 vs\&. AES\-256\&. When providing a 16 byte key for an AES cipher handle, AES\-128 is performed\&. .SH "RETURN" .PP 0 if the setting of the key was successful; < 0 if an error occurred .SH "AUTHORS" .PP \fBStephan Mueller\fR <\&smueller@chronox.de\&> .RS 4 Author. .RE .PP \fBMarek Vasut\fR <\&marek@denx.de\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br