# Hardware crypto for Mediatek missing?

**URL:** <https://forum.openwrt.org/t/hardware-crypto-for-mediatek-missing/3314>\
**Category:** For Developers\
**Created:** [April 26, 2017, 2:39pm UTC](https://forum.openwrt.org/t/hardware-crypto-for-mediatek-missing/3314 "2017-04-26T14:39:05Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![drbrains](https://forum.openwrt.org/user_avatar/forum.openwrt.org/drbrains/32/55252_2.png) [@drbrains](https://forum.openwrt.org/u/drbrains)\
**Post date:** [May 13, 2017, 5:01pm UTC](https://forum.openwrt.org/t/hardware-crypto-for-mediatek-missing/3314/19 "2017-05-13T17:01:15Z")

</div>

Succes 😃 !!

root@LEDE:~# rmmod mtk\_aes  
root@LEDE:~# time -v openssl speed -elapsed -evp aes-256-cbc -engine cryptodev  
engine "cryptodev" set.  
You have chosen to measure elapsed time instead of user CPU time.  
Doing aes-256-cbc for 3s on 16 size blocks: 276675 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 64 size blocks: 153719 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 256 size blocks: 54902 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 1024 size blocks: 13558 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 8192 size blocks: 2002 aes-256-cbc's in 2.97s  
OpenSSL 1.0.2k 26 Jan 2017  
built on: reproducible build, date unspecified  
options:bn(64,32) rc4(ptr,char) des(idx,cisc,2,long) aes(partial) blowfish(ptr)  
compiler: mipsel-openwrt-linux-musl-gcc -I. -I.. -I../include -fPIC -DOPENSSL\_PIC -DOPENSSL\_THREADS -D\_REENTRANT -DDSO\_DLFCN -DHAVE\_DLFCN\_H -I/home/richard/lede\_new/source/staging\_dir/target-mipsel\_24kc\_musl/usr/include -I/home/richard/lede\_new/source/staging\_dir/target-mipsel\_24kc\_musl/include -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/usr/include -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/include/fortify -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/include -znow -zrelro -DOPENSSL\_SMALL\_FOOTPRINT -DHAVE\_CRYPTODEV -DUSE\_CRYPTODEV\_DIGESTS -DOPENSSL\_NO\_ERR -DTERMIOS -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/home/richard/lede\_new/source/build\_dir/target-mipsel\_24kc\_musl/openssl-1.0.2k:openssl-1.0.2k -Wformat -Werror=format-security -fstack-protector -D\_FORTIFY\_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -I/home/richard/lede\_new/source/package/libs/openssl/include -ffunction-sections -fdata-sections -fomit-frame-pointer -Wall -DOPENSSL\_BN\_ASM\_MONT -DSHA1\_ASM -DSHA256\_ASM -DAES\_ASM  
The 'numbers' are in 1000s of bytes per second processed.  
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes  
aes-256-cbc 1490.51k 3312.46k 4732.29k 4674.54k 5522.01k  
Command being timed: "openssl speed -elapsed -evp aes-256-cbc -engine cryptodev"  
User time (seconds): 0.49  
System time (seconds): 14.02  
Percent of CPU this job got: 90%  
Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.96s  
Average shared text size (kbytes): 0  
Average unshared data size (kbytes): 0  
Average stack size (kbytes): 0  
Average total size (kbytes): 0  
Maximum resident set size (kbytes): 10400  
Average resident set size (kbytes): 0  
Major (requiring I/O) page faults: 0  
Minor (reclaiming a frame) page faults: 111  
Voluntary context switches: 83  
Involuntary context switches: 454  
Swaps: 0  
File system inputs: 0  
File system outputs: 0  
Socket messages sent: 0  
Socket messages received: 0  
Signals delivered: 0  
Page size (bytes): 4096  
Exit status: 0  
root@LEDE:~# modprobe mtk\_aes b=16  
root@LEDE:~# time -v openssl speed -elapsed -evp aes-256-cbc -engine cryptodev  
engine "cryptodev" set.  
You have chosen to measure elapsed time instead of user CPU time.  
Doing aes-256-cbc for 3s on 16 size blocks: 116585 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 64 size blocks: 116865 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 256 size blocks: 104425 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 1024 size blocks: 95388 aes-256-cbc's in 2.97s  
Doing aes-256-cbc for 3s on 8192 size blocks: 34593 aes-256-cbc's in 2.97s  
OpenSSL 1.0.2k 26 Jan 2017  
built on: reproducible build, date unspecified  
options:bn(64,32) rc4(ptr,char) des(idx,cisc,2,long) aes(partial) blowfish(ptr)  
compiler: mipsel-openwrt-linux-musl-gcc -I. -I.. -I../include -fPIC -DOPENSSL\_PIC -DOPENSSL\_THREADS -D\_REENTRANT -DDSO\_DLFCN -DHAVE\_DLFCN\_H -I/home/richard/lede\_new/source/staging\_dir/target-mipsel\_24kc\_musl/usr/include -I/home/richard/lede\_new/source/staging\_dir/target-mipsel\_24kc\_musl/include -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/usr/include -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/include/fortify -I/home/richard/lede\_new/source/staging\_dir/toolchain-mipsel\_24kc\_gcc-6.3.0\_musl/include -znow -zrelro -DOPENSSL\_SMALL\_FOOTPRINT -DHAVE\_CRYPTODEV -DUSE\_CRYPTODEV\_DIGESTS -DOPENSSL\_NO\_ERR -DTERMIOS -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/home/richard/lede\_new/source/build\_dir/target-mipsel\_24kc\_musl/openssl-1.0.2k:openssl-1.0.2k -Wformat -Werror=format-security -fstack-protector -D\_FORTIFY\_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -I/home/richard/lede\_new/source/package/libs/openssl/include -ffunction-sections -fdata-sections -fomit-frame-pointer -Wall -DOPENSSL\_BN\_ASM\_MONT -DSHA1\_ASM -DSHA256\_ASM -DAES\_ASM  
The 'numbers' are in 1000s of bytes per second processed.  
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes  
aes-256-cbc 628.07k 2518.30k 9000.94k 32887.98k 95416.11k  
Command being timed: "openssl speed -elapsed -evp aes-256-cbc -engine cryptodev"  
User time (seconds): 1.26  
System time (seconds): 8.41  
Percent of CPU this job got: 60%  
Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 15.92s  
Average shared text size (kbytes): 0  
Average unshared data size (kbytes): 0  
Average stack size (kbytes): 0  
Average total size (kbytes): 0  
Maximum resident set size (kbytes): 10400  
Average resident set size (kbytes): 0  
Major (requiring I/O) page faults: 0  
Minor (reclaiming a frame) page faults: 112  
Voluntary context switches: 466871  
Involuntary context switches: 284  
Swaps: 0  
File system inputs: 0  
File system outputs: 0  
Socket messages sent: 0  
Socket messages received: 0  
Signals delivered: 0  
Page size (bytes): 4096  
Exit status: 0  
root@LEDE:~# ^C  
root@LEDE:~# cat /proc/interrupts  
CPU0  
4: 1232369 MIPS 4 mt76x2e  
5: 627685 MIPS 5 10100000.ethernet  
6: 21 MIPS 6 mt7603e  
7: 144167 MIPS 7 timer  
21: 3936726 INTC 13 aes\_engine  
25: 9 INTC 17 esw  
28: 12 INTC 20 serial  
40: 0 GPIO 38 gpio-keys  
ERR: 151694  
root@LEDE:~#

---

_[View the full topic](https://forum.openwrt.org/t/hardware-crypto-for-mediatek-missing/3314)._
