shadowsocks-libev icon indicating copy to clipboard operation
shadowsocks-libev copied to clipboard

Add SM4 cipher (GB/T 32907-2016) support from SM4 enabled mbed TLS library

Open Low-power opened this issue 6 years ago • 4 comments

Hello.

There is a SM4 cipher support for mbed TLS in pull request https://github.com/ARMmbed/mbedtls/pull/1165 some years. Unfortunately that pull request was still left unmerged and became outdated in current mbed TLS versions; however I still managed to merge that pull request into the long term support branch 2.7, and with this minor modification to shadowsocks-libev, the SM4 ciphers appears fully functional in shadowsocks-libev. The implemented ciphers in shadowsocks-libev are sm4-128-cbc, sm4-128-ctr and sm4-128-gcm.

Until https://github.com/ARMmbed/mbedtls/pull/1165 can be merged, mbed TLS woudn't offically supporting SM4 cipher, however I opened this pull request for discuss whether to check a downstream version of mbed TLS of this SM4 support, in shadowsocks-libev.

My mbed TLS branch with SM4 support merged is available at https://git.nsscn.top/Low-power/mbedtls/tree/mbedtls-2.7-sm4

Low-power avatar Jul 09 '19 02:07 Low-power

For any cipher change, please go to https://github.com/shadowsocks/shadowsocks-org/issues

madeye avatar Jul 09 '19 05:07 madeye

Using SM4 for anti-censoring...This PR could definitely piss off those officers of OSCCA 🤣

ttimasdf avatar Nov 21 '19 06:11 ttimasdf

anti-censoring

Maybe anti-(NSA's)censoring🤣

ghost avatar Nov 21 '19 10:11 ghost

Since the old repository I hosted my Mbed TLS fork has long gone, I republished the repository at https://github.com/Low-power/mbedtls/tree/mbedtls-2.7-sm4 for anyone interested in that.

Low-power avatar Feb 28 '23 14:02 Low-power