Skip to content

Instantly share code, notes, and snippets.

@hanapedia
Last active May 11, 2025 03:56
Show Gist options
  • Save hanapedia/1261b4b58693b75747134e98b3111773 to your computer and use it in GitHub Desktop.
Save hanapedia/1261b4b58693b75747134e98b3111773 to your computer and use it in GitHub Desktop.
OpenSSL AES-128-CTR performance on M1 mac

On native with 0x987d (default)

$ openssl speed -evp aes-128-ctr
Doing AES-128-CTR ops for 3s on 16 size blocks: 106011644 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 64 size blocks: 188739259 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 256 size blocks: 95282789 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 1024 size blocks: 32868293 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 8192 size blocks: 4607134 AES-128-CTR ops in 3.01s
Doing AES-128-CTR ops for 3s on 16384 size blocks: 2330313 AES-128-CTR ops in 3.00s
version: 3.4.1
built on: Tue Feb 11 14:29:27 2025 UTC
options: bn(64,64)
compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0x987d
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-CTR     565395.43k  4026437.53k  8130797.99k 11219044.01k 12538751.40k 12726616.06k

On native with 0x4

$ OPENSSL_armcap=0x4 openssl speed -evp aes-128-ctr
Doing AES-128-CTR ops for 3s on 16 size blocks: 106904664 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 64 size blocks: 188627181 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 256 size blocks: 95126151 AES-128-CTR ops in 3.01s
Doing AES-128-CTR ops for 3s on 1024 size blocks: 32849120 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 8192 size blocks: 4615397 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 16384 size blocks: 2326180 AES-128-CTR ops in 3.00s
version: 3.4.1
built on: Tue Feb 11 14:29:27 2025 UTC
options: bn(64,64)
compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0x4 env:0x4
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-CTR     570158.21k  4024046.53k  8090463.34k 11212499.63k 12603110.74k 12704044.37k

On alpine container with 0x8fd (default)

$ docker run -it --rm alpine sh -c "apk add openssl && openssl speed -evp aes-128-ctr"                        19.2s
fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/community/aarch64/APKINDEX.tar.gz
(1/1) Installing openssl (3.3.3-r0)
Executing busybox-1.37.0-r12.trigger
OK: 8 MiB in 16 packages
Doing AES-128-CTR ops for 3s on 16 size blocks: 128320320 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 64 size blocks: 117561311 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 256 size blocks: 74682791 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 1024 size blocks: 29177192 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 8192 size blocks: 4508381 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 16384 size blocks: 2293184 AES-128-CTR ops in 3.00s
version: 3.3.3
built on: Tue Feb 11 17:51:32 2025 UTC
options: bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Os -fstack-clash-protection -Wformat -Werror=format-security -g -Os -fstack-clash-protection -Wformat -Werror=format-security -g -Wa,--noexecstack -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0x8fd
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-CTR     684375.04k  2507974.63k  6372931.50k  9959148.20k 12310885.72k 12523842.22k

On alpine container with 0x4

$ docker run -it --rm alpine sh -c "apk add openssl && OPENSSL_armcap=0x4 openssl speed -evp aes-128-ctr"     19.3s
fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/community/aarch64/APKINDEX.tar.gz
(1/1) Installing openssl (3.3.3-r0)
Executing busybox-1.37.0-r12.trigger
OK: 8 MiB in 16 packages
Doing AES-128-CTR ops for 3s on 16 size blocks: 127654445 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 64 size blocks: 117765048 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 256 size blocks: 74775305 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 1024 size blocks: 29179401 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 8192 size blocks: 4518229 AES-128-CTR ops in 3.00s
Doing AES-128-CTR ops for 3s on 16384 size blocks: 2290755 AES-128-CTR ops in 3.01s
version: 3.3.3
built on: Tue Feb 11 17:51:32 2025 UTC
options: bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Os -fstack-clash-protection -Wformat -Werror=format-security -g -Os -fstack-clash-protection -Wformat -Werror=format-security -g -Wa,--noexecstack -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_armcap=0x4 env:0x4
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-CTR     680823.71k  2512321.02k  6380826.03k  9959902.21k 12337777.32k 12469013.26k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment