Giter VIP home page Giter VIP logo

howto-openssl's People

Contributors

mdaxini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

howto-openssl's Issues

The epoll_tls_client.c example is wrong

First, it seems to be busy-looping when calling SSL_connect(). Second, it only calls SSL_read() when the socket is readable and only calls SSL_write() when it is writeable. However, SSL_write() can be blocked for reading, for example during renegotiation (see manual page).

This is a problem because this example is one of the first result when looking for openssl epoll with some search engines.

incorrect instructions on wiki

https://github.com/mdaxini/howto-openssl/wiki/OpenSSL-Cipher-Speed

The openssl manual notes: https://wiki.openssl.org/index.php/Manual:OPENSSL_ia32cap(3)
OPENSSL_ia32cap:
bit #33 denoting availability of PCLMULQDQ instruction;
bit #57 denoting AES-NI instruction set extension;

Disabling both results in different performance between having AES-NI on and off in the BIOS.

The difference is not noticeable in aes-128-cbc, but is in other algorithms:

== Disable Both AES-NI and PCLMULQDQ ==

OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-128-cbc

AES-NI ON: 363 MB/s
AES-NI OFF: 363 MB/s

OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-128-gcm

AES-NI ON: 260 MB/s
AES-NI OFF: 260 MB/s

== Disabled only AES-NI ==

OPENSSL_ia32cap="~0x200000000000000" openssl speed -elapsed -evp aes-128-cbc

AES-NI ON: 363 MB/s
AES-NI OFF: 363 MB/s

OPENSSL_ia32cap="~0x200000000000000" openssl speed -elapsed -evp aes-128-gcm

AES-NI ON: 516 MB/s
AES-NI OFF: 516 MB/s

== Normal ==

openssl speed -elapsed -evp aes-128-cbc

AES-NI ON: 768 MB/s
AES-NI OFF: 363 MB/s

openssl speed -elapsed -evp aes-128-gcm

AES-NI ON: 3315 MB/s
AES-NI OFF: 516 MB/s

As you can see, under aes-128-gcm, disabling the additional instructions, rather than just AES-NI, cuts performance in half.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.