intro.rst 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Kernel Crypto API Interface Specification
  2. =========================================
  3. Introduction
  4. ------------
  5. The kernel crypto API offers a rich set of cryptographic ciphers as well
  6. as other data transformation mechanisms and methods to invoke these.
  7. This document contains a description of the API and provides example
  8. code.
  9. To understand and properly use the kernel crypto API a brief explanation
  10. of its structure is given. Based on the architecture, the API can be
  11. separated into different components. Following the architecture
  12. specification, hints to developers of ciphers are provided. Pointers to
  13. the API function call documentation are given at the end.
  14. The kernel crypto API refers to all algorithms as "transformations".
  15. Therefore, a cipher handle variable usually has the name "tfm". Besides
  16. cryptographic operations, the kernel crypto API also knows compression
  17. transformations and handles them the same way as ciphers.
  18. The kernel crypto API serves the following entity types:
  19. - consumers requesting cryptographic services
  20. - data transformation implementations (typically ciphers) that can be
  21. called by consumers using the kernel crypto API
  22. This specification is intended for consumers of the kernel crypto API as
  23. well as for developers implementing ciphers. This API specification,
  24. however, does not discuss all API calls available to data transformation
  25. implementations (i.e. implementations of ciphers and other
  26. transformations (such as CRC or even compression algorithms) that can
  27. register with the kernel crypto API).
  28. Note: The terms "transformation" and cipher algorithm are used
  29. interchangeably.
  30. Terminology
  31. -----------
  32. The transformation implementation is an actual code or interface to
  33. hardware which implements a certain transformation with precisely
  34. defined behavior.
  35. The transformation object (TFM) is an instance of a transformation
  36. implementation. There can be multiple transformation objects associated
  37. with a single transformation implementation. Each of those
  38. transformation objects is held by a crypto API consumer or another
  39. transformation. Transformation object is allocated when a crypto API
  40. consumer requests a transformation implementation. The consumer is then
  41. provided with a structure, which contains a transformation object (TFM).
  42. The structure that contains transformation objects may also be referred
  43. to as a "cipher handle". Such a cipher handle is always subject to the
  44. following phases that are reflected in the API calls applicable to such
  45. a cipher handle:
  46. 1. Initialization of a cipher handle.
  47. 2. Execution of all intended cipher operations applicable for the handle
  48. where the cipher handle must be furnished to every API call.
  49. 3. Destruction of a cipher handle.
  50. When using the initialization API calls, a cipher handle is created and
  51. returned to the consumer. Therefore, please refer to all initialization
  52. API calls that refer to the data structure type a consumer is expected
  53. to receive and subsequently to use. The initialization API calls have
  54. all the same naming conventions of crypto_alloc\*.
  55. The transformation context is private data associated with the
  56. transformation object.