paragonie / phpecc

Pure PHP Elliptic Curve Cryptography Library
16 stars 3 forks source link

Use OpenSSL for better security/perf if possible #22

Closed paragonie-security closed 5 months ago

paragonie-security commented 5 months ago

Closes #19

If you have ext-openssl installed, with OpenSSL 3.0 or newer, on PHP 8.1 or newer, this will prefer OpenSSL for ECDH (in all cases) and ECDSA (if you use the new signMessage() and verifyMessage() API).

You can disable it by calling disableOpenssl() on a specific curve instance, or a specific EcDH or Signer instance. If you set the disable flag in either place, it will disable it for the execution.

This should speed up a lot of deployments and adhere to the zeroth rule of PHP cryptography.