Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    openvpn no option for AES-NI

    Scheduled Pinned Locked Moved 2.5 Development Snapshots (Retired)
    18 Posts 5 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • GertjanG
      Gertjan
      last edited by

      Nice, you confirmed issue https://redmine.pfsense.org/issues/9646

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 0
      • JeGrJ
        JeGr LAYER 8 Moderator
        last edited by JeGr

        Besides it being pointless to use "idrand" if you want to check AES-NI capability? If you want that wouldn't you either use no engine at all (because automatic detection of openssl) or crypt(dev)?

        Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

        If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

        1 Reply Last reply Reply Quote 0
        • V
          viragomann @yon 0
          last edited by

          @yon-0
          Run openssl speed without stating an engine.

          openssl speed -elapsed -evp aes-128-gcm
          

          than run it again with AES-NI turned off:

          OPENSSL_ia32cap="-0x200000200000000" openssl speed -elapsed -evp aes-128-gcm
          
          yon 0Y 1 Reply Last reply Reply Quote 0
          • yon 0Y
            yon 0 @viragomann
            last edited by

            @viragomann said in openvpn no option for AES-NI:

            openssl speed -elapsed -evp aes-128-gcm

            openssl speed -elapsed -evp aes-128-gcm
            You have chosen to measure elapsed time instead of user CPU time.
            Doing aes-128-gcm for 3s on 16 size blocks: 41969785 aes-128-gcm's in 3.01s
            Doing aes-128-gcm for 3s on 64 size blocks: 32052818 aes-128-gcm's in 3.00s
            Doing aes-128-gcm for 3s on 256 size blocks: 14958024 aes-128-gcm's in 3.00s
            Doing aes-128-gcm for 3s on 1024 size blocks: 4775151 aes-128-gcm's in 3.07s
            Doing aes-128-gcm for 3s on 8192 size blocks: 619225 aes-128-gcm's in 3.02s
            Doing aes-128-gcm for 3s on 16384 size blocks: 309571 aes-128-gcm's in 3.01s
            OpenSSL 1.1.1a-freebsd 20 Nov 2018
            built on: reproducible build, date unspecified
            options:bn(64,64) rc4(8x,int) des(int) aes(partial) idea(int) blowfish(ptr)
            compiler: clang
            The 'numbers' are in 1000s of bytes per second processed.
            type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
            aes-128-gcm 223257.45k 683793.45k 1276418.05k 1592591.84k 1677789.34k 1686279.07k

            1 Reply Last reply Reply Quote 0
            • yon 0Y
              yon 0
              last edited by

              @JeGr said in openvpn no option for AES-NI:

              AES-NI

              The question is how do I know that vpn works with AES-NI

              1 Reply Last reply Reply Quote 0
              • V
                viragomann
                last edited by

                @yon-0 said in openvpn no option for AES-NI:

                The question is how do I know that vpn works with AES-NI

                I gave you two benchmarks, one uses AES-NI if available, the other runs without.
                So run both, compare the results and you will see if your system benefits from AES-NI or not.

                yon 0Y 1 Reply Last reply Reply Quote 0
                • yon 0Y
                  yon 0 @viragomann
                  last edited by

                  @viragomann

                  OPENSSL_ia32cap="-0x200000200000000" openssl speed -elapsed -evp aes-128-gcm
                  OPENSSL_ia32cap=-0x200000200000000: Command not found.

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    viragomann @yon 0
                    last edited by

                    @yon-0
                    Run it in the GUI.

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      Use env to set variables like that, for example:

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

                      So... With AES-NI active:

                      [2.5.0-DEVELOPMENT][]/root: openssl speed -elapsed -evp aes-128-gcm
                      You have chosen to measure elapsed time instead of user CPU time.
                      Doing aes-128-gcm for 3s on 16 size blocks: 20389193 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 64 size blocks: 10049858 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 256 size blocks: 3680033 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 1024 size blocks: 1042002 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 8192 size blocks: 134501 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 16384 size blocks: 67574 aes-128-gcm's in 3.00s
                      OpenSSL 1.1.1a-freebsd  20 Nov 2018
                      built on: reproducible build, date unspecified
                      options:bn(64,64) rc4(16x,int) des(int) aes(partial) idea(int) blowfish(ptr) 
                      compiler: clang
                      The 'numbers' are in 1000s of bytes per second processed.
                      type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
                      aes-128-gcm     108742.36k   214396.97k   314029.48k   355670.02k   367277.40k   369044.14k
                      

                      With AES-NI disabled:

                      [2.5.0-DEVELOPMENT][]/root: env OPENSSL_ia32cap="-0x200000200000000" openssl speed -elapsed -evp aes-128-gcm
                      You have chosen to measure elapsed time instead of user CPU time.
                      Doing aes-128-gcm for 3s on 16 size blocks: 5138331 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 64 size blocks: 1531164 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 256 size blocks: 403121 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 1024 size blocks: 102245 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 8192 size blocks: 12855 aes-128-gcm's in 3.00s
                      Doing aes-128-gcm for 3s on 16384 size blocks: 6428 aes-128-gcm's in 3.00s
                      OpenSSL 1.1.1a-freebsd  20 Nov 2018
                      built on: reproducible build, date unspecified
                      options:bn(64,64) rc4(8x,int) des(int) aes(partial) idea(int) blowfish(ptr) 
                      compiler: clang
                      The 'numbers' are in 1000s of bytes per second processed.
                      type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
                      aes-128-gcm      27404.43k    32664.83k    34399.66k    34899.63k    35102.72k    35105.45k
                      

                      Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • yon 0Y
                        yon 0
                        last edited by

                        @jimp said in openvpn no option for AES-NI:

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

                        but i test it is slow

                        env OPENSSL_ia32cap="-0x200000200000000" openssl speed -elapsed -evp aes-128-gcm
                        You have chosen to measure elapsed time instead of user CPU time.
                        Doing aes-128-gcm for 3s on 16 size blocks: 12357003 aes-128-gcm's in 3.00s
                        Doing aes-128-gcm for 3s on 64 size blocks: 3672554 aes-128-gcm's in 3.02s
                        Doing aes-128-gcm for 3s on 256 size blocks: 960619 aes-128-gcm's in 3.00s
                        Doing aes-128-gcm for 3s on 1024 size blocks: 246105 aes-128-gcm's in 3.03s
                        Doing aes-128-gcm for 3s on 8192 size blocks: 31427 aes-128-gcm's in 3.08s
                        Doing aes-128-gcm for 3s on 16384 size blocks: 15772 aes-128-gcm's in 3.09s
                        OpenSSL 1.1.1a-freebsd 20 Nov 2018
                        built on: reproducible build, date unspecified
                        options:bn(64,64) rc4(8x,int) des(int) aes(partial) idea(int) blowfish(ptr)
                        compiler: clang
                        The 'numbers' are in 1000s of bytes per second processed.
                        type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
                        aes-128-gcm 65904.02k 77740.47k 81972.82k 83137.82k 83638.57k 83525.96k

                        1 Reply Last reply Reply Quote 0
                        • JeGrJ
                          JeGr LAYER 8 Moderator
                          last edited by

                          Of course it's slow, the ENV command disables AES-NI. Did you read what @viragomann or @jimp wrote?

                          @viragomann said in openvpn no option for AES-NI:

                          Run openssl speed without stating an engine.
                          openssl speed -elapsed -evp aes-128-gcm

                          than run it again with AES-NI turned off:
                          OPENSSL_ia32cap="-0x200000200000000" openssl speed -elapsed -evp aes-128-gcm

                          So of course your test with the ENV in front is slow:

                          @yon-0 said in openvpn no option for AES-NI:

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

                          ...
                          aes-128-gcm 65904.02k 77740.47k 81972.82k 83137.82k 83638.57k 83525.96k

                          compared to the one before without the ENV trigger:

                          openssl speed -elapsed -evp aes-128-gcm
                          ...
                          aes-128-gcm 223257.45k 683793.45k 1276418.05k 1592591.84k 1677789.34k 1686279.07k

                          Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

                          If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.