title: How to register my own algorithm to Linux crypto API for user mode apps
body: <p>I'm a newbie in Linux kernel(and crypto API). Currently I'm applying hardware crypto into user mode apps like OpenSSL, etc. I searched a lot but still not understand very clearly.</p>
  <p><strong>My first question is,</strong> is the following all I should do?</p>
  <ul>
  <li>First, I should register my own algorithm to Linux kernel's Crypto API.</li>
  <li>Then, I need to call the algorithm registered above from OpenSSL, etc., via AF_ALG or cryptodev(not preferred because it's GPL licensed).</li>
  </ul>
  <p>Within the first step, where should I deploy the registration code(hacking the linux kernel or deploying it in user mode apps?) And is there any simple example of the implementation?</p>
  <p>My algorithms are some APIs which communicate with the hardware to start the actual crypto process, including symmetric/asymmetric encryptions and hash/hmac. For example,</p>
  <pre><code>uint32_t AES_ecb(uint32_t addr_src, uint32_t addr_dest, uint32_t length, uint8_t key_idx, uint8_t encORdec)
  </code></pre>
  <p>Apparently it differs a lot from the original Crypto API interface. <strong>So my second question is,</strong> for the purpose of reducing wrappers(and improve the speed), is it necessary to modify this API to fit Crypto API(or there isn't too much differences so I needn't to contact the vendor)?</p>
  <p>I have searched a lot about Crypto API (like keywords of crypto_alg and AF_ALG), but there isn't much detailed informations about registration of an algorithm.</p>