1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Synchronous And Asynchronous Operation</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Kernel Crypto API"><link rel="up" href="Architecture.html" title="Chapter 2. Kernel Crypto API Architecture"><link rel="prev" href="ch02s02.html" title="Ciphers And Templates"><link rel="next" href="ch02s04.html" title="Crypto API Cipher References And Priority"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Synchronous And Asynchronous Operation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Kernel Crypto API Architecture</th><td width="20%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1094540300"></a>Synchronous And Asynchronous Operation</h2></div></div></div><p> 2 The kernel crypto API provides synchronous and asynchronous 3 API operations. 4 </p><p> 5 When using the synchronous API operation, the caller invokes 6 a cipher operation which is performed synchronously by the 7 kernel crypto API. That means, the caller waits until the 8 cipher operation completes. Therefore, the kernel crypto API 9 calls work like regular function calls. For synchronous 10 operation, the set of API calls is small and conceptually 11 similar to any other crypto library. 12 </p><p> 13 Asynchronous operation is provided by the kernel crypto API 14 which implies that the invocation of a cipher operation will 15 complete almost instantly. That invocation triggers the 16 cipher operation but it does not signal its completion. Before 17 invoking a cipher operation, the caller must provide a callback 18 function the kernel crypto API can invoke to signal the 19 completion of the cipher operation. Furthermore, the caller 20 must ensure it can handle such asynchronous events by applying 21 appropriate locking around its data. The kernel crypto API 22 does not perform any special serialization operation to protect 23 the caller's data integrity. 24 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="Architecture.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Ciphers And Templates </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Crypto API Cipher References And Priority</td></tr></table></div></body></html> 25