Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add engine bindings #2194

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

SercanKaraoglu
Copy link

@SercanKaraoglu SercanKaraoglu commented Feb 29, 2024

Draft GitHub PR for adding OpenSSL engine support:

Allow using OpenSSL engines

This PR adds the ability to load and use OpenSSL engines for hardware acceleration and offloading of crypto operations.

Some of the key functionality we want to implement is:

  • Load builtin OpenSSL engines
  • Register all engines
  • Load an engine by ID (e.g. "dynamic")
  • Control the engine by passing command strings
  • Set engine parameters (e.g. SO path)
  • Initialize and add the engine
  • Set as the default engine
  • Get engine name and ID

Benefits:
Hardware acceleration of crypto workloads
Leverage optimizations in OpenSSL engines
Improve performance of cryptography

This enables tapping into OpenSSL engines like the QuickAssist engine for hardware accelerated cryptography.

Usage example:

let _ = Engine::load_builtin_engines(); 
let _ = Engine::register_all_complete();
let mut e = Engine::by_id("dynamic").unwrap();
println!("cmd so path: {}", e.ctrl_cmd_string("SO_PATH", "/opt/openssl/1.1.1e/lib/engines-1.1/qatengine.so", 0).unwrap());
println!("cmd load {}", e.load().unwrap());
println!("init = {}", e.init().unwrap());
println!("add = {}", e.add().unwrap());
println!("cmd set default {}", e.set_default(0xFFFF).unwrap());
println!("name={}, id={}", e.get_name().unwrap(), e.get_id().unwrap());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants