Linux Kernel Crypto API

Stephan Mueller


      
     

Marek Vasut


      
     

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more details see the file COPYING in the source distribution of Linux.


Table of Contents

1. Kernel Crypto API Interface Specification
Introduction
Terminology
2. Kernel Crypto API Architecture
Cipher algorithm types
Ciphers And Templates
Synchronous And Asynchronous Operation
Crypto API Cipher References And Priority
Key Sizes
Cipher Allocation Type And Masks
Internal Structure of Kernel Crypto API
Generic AEAD Cipher Structure
Generic Block Cipher Structure
Generic Keyed Message Digest Structure
3. Developing Cipher Algorithms
Registering And Unregistering Transformation
Single-Block Symmetric Ciphers [CIPHER]
Registration specifics
Cipher Definition With struct cipher_alg
Multi-Block Ciphers [BLKCIPHER] [ABLKCIPHER]
Registration Specifics
Cipher Definition With struct blkcipher_alg and ablkcipher_alg
Specifics Of Asynchronous Multi-Block Cipher
Hashing [HASH]
Registering And Unregistering The Transformation
Cipher Definition With struct shash_alg and ahash_alg
Specifics Of Asynchronous HASH Transformation
4. User Space Interface
Introduction
User Space API General Remarks
In-place Cipher operation
Message Digest API
Symmetric Cipher API
AEAD Cipher API
AEAD Memory Structure
Random Number Generator API
Zero-Copy Interface
Setsockopt Interface
User space API example
5. Programming Interface
Block Cipher Context Data Structures
Block Cipher Algorithm Definitions
Asynchronous Block Cipher API
Asynchronous Cipher Request Handle
Authenticated Encryption With Associated Data (AEAD) Cipher API
Asynchronous AEAD Request Handle
Synchronous Block Cipher API
Single Block Cipher API
Synchronous Message Digest API
Message Digest Algorithm Definitions
Asynchronous Message Digest API
Asynchronous Hash Request Handle
Synchronous Message Digest API
Crypto API Random Number API
6. Code Examples
Code Example For Asynchronous Block Cipher Operation
Code Example For Synchronous Block Cipher Operation
Code Example For Use of Operational State Memory With SHASH
Code Example For Random Number Generator Usage