'\" t .\" Title: struct ablkcipher_alg .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: April 2019 .\" Manual: Programming Interface .\" Source: Kernel Hackers Manual 4.9.168 .\" Language: English .\" .TH "STRUCT ABLKCIPHER_AL" "9" "April 2019" "Kernel Hackers Manual 4\&.9\&." "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" struct_ablkcipher_alg \- asynchronous block cipher definition .SH "SYNOPSIS" .sp .nf struct ablkcipher_alg { int (* setkey) (struct crypto_ablkcipher *tfm, const u8 *key,unsigned int keylen); int (* encrypt) (struct ablkcipher_request *req); int (* decrypt) (struct ablkcipher_request *req); int (* givencrypt) (struct skcipher_givcrypt_request *req); int (* givdecrypt) (struct skcipher_givcrypt_request *req); const char * geniv; unsigned int min_keysize; unsigned int max_keysize; unsigned int ivsize; }; .fi .SH "MEMBERS" .PP setkey .RS 4 Set key for the transformation\&. This function is used to either program a supplied key into the hardware or store the key in the transformation context for programming it later\&. Note that this function does modify the transformation context\&. This function can be called multiple times during the existence of the transformation object, so one must make sure the key is properly reprogrammed into the hardware\&. This function is also responsible for checking the key length for validity\&. In case a software fallback was put in place in the \fIcra_init\fR call, this function might need to use the fallback if the algorithm doesn\*(Aqt support all of the key sizes\&. .RE .PP encrypt .RS 4 Encrypt a scatterlist of blocks\&. This function is used to encrypt the supplied scatterlist containing the blocks of data\&. The crypto API consumer is responsible for aligning the entries of the scatterlist properly and making sure the chunks are correctly sized\&. In case a software fallback was put in place in the \fIcra_init\fR call, this function might need to use the fallback if the algorithm doesn\*(Aqt support all of the key sizes\&. In case the key was stored in transformation context, the key might need to be re\-programmed into the hardware in this function\&. This function shall not modify the transformation context, as this function may be called in parallel with the same transformation object\&. .RE .PP decrypt .RS 4 Decrypt a single block\&. This is a reverse counterpart to \fIencrypt\fR and the conditions are exactly the same\&. .RE .PP givencrypt .RS 4 Update the IV for encryption\&. With this function, a cipher implementation may provide the function on how to update the IV for encryption\&. .RE .PP givdecrypt .RS 4 Update the IV for decryption\&. This is the reverse of \fIgivencrypt\fR \&. .RE .PP geniv .RS 4 The transformation implementation may use an \(lqIV generator\(rq provided by the kernel crypto API\&. Several use cases have a predefined approach how IVs are to be updated\&. For such use cases, the kernel crypto API provides ready\-to\-use implementations that can be referenced with this variable\&. .RE .PP min_keysize .RS 4 Minimum key size supported by the transformation\&. This is the smallest key length supported by this transformation algorithm\&. This must be set to one of the pre\-defined values as this is not hardware specific\&. Possible values for this field can be found via git grep \(lq_MIN_KEY_SIZE\(rq include/crypto/ .RE .PP max_keysize .RS 4 Maximum key size supported by the transformation\&. This is the largest key length supported by this transformation algorithm\&. This must be set to one of the pre\-defined values as this is not hardware specific\&. Possible values for this field can be found via git grep \(lq_MAX_KEY_SIZE\(rq include/crypto/ .RE .PP ivsize .RS 4 IV size applicable for transformation\&. The consumer must provide an IV of exactly that size to perform the encrypt or decrypt operation\&. .RE .SH "DESCRIPTION" .PP All fields except \fIgivencrypt\fR , \fIgivdecrypt\fR , \fIgeniv\fR and \fIivsize\fR are mandatory and must be filled\&. .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