[ 
https://issues.apache.org/jira/browse/CRYPTO-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17553551#comment-17553551
 ] 

wenweijian commented on CRYPTO-162:
-----------------------------------

we want to use a hardware device to accelerate to cipher.

In Openssl native code, we can use `engine_by_id()` to get the engine, and then 
use `ENGINE_set_default_ciphers(e)` to set the specified engine to do ciphers.

 

[https://www.openssl.org/docs/man1.1.1/man3/ENGINE_set_default.html]

Here is a example:

```

ENGINE *e;
 const char *engine_id = "ACME";
 ENGINE_load_builtin_engines();
 e = ENGINE_by_id(engine_id);
 if (!e)
     /* the engine isn't available */
     return;
 if (!ENGINE_init(e)) {
     /* the engine couldn't initialise, release 'e' */
     ENGINE_free(e);
     return;
 }
 ENGINE_set_default_ciphers(e);
 /* Release the functional reference from ENGINE_init() */
 ENGINE_finish(e);
 /* Release the structural reference from ENGINE_by_id() */
 ENGINE_free(e);

```

> openSslCipher support engine
> ----------------------------
>
>                 Key: CRYPTO-162
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-162
>             Project: Commons Crypto
>          Issue Type: New Feature
>          Components: Cipher
>            Reporter: wenweijian
>            Priority: Minor
>
> The engine is the hardware or software implementation used for performing 
> cryptographic operations.
>  
> Assume we have a hardware device with a super fast implementation of AES. Now 
> when we use AES encryption we can set the engine to that hardware device 
> (instead of {{{}NULL{}}}), which means that the operations are now computed 
> by the hardware device instead of the default OpenSSL software layer.
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to