Commit a0c3e4fa authored by Jack Lloyd's avatar Jack Lloyd Committed by Ronald Tse
Browse files

SM3: Add SM3 hash function



SM3 is a secure hash function which is part of the Chinese
"Commercial Cryptography" suite of algorithms which use is
required for certain commercial applications in China.

Reviewed-by: default avatarPaul Dale <paul.dale@oracle.com>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4616)
parent cf72c757
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@
 Changes between 1.1.0f and 1.1.1 [xx XXX xxxx]
  *) Add SM3 implemented according to GB/T 32905-2016
     [ Jack Lloyd <jack.lloyd@ribose.com>,
       Ronald Tse <ronald.tse@ribose.com>,
       Erick Borsboom <erick.borsboom@ribose.com> ]
  *) Add 'Maximum Fragment Length' TLS extension negotiation and support
     as documented in RFC6066.
     Based on a patch from Tomasz Moń
+2 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ $config{dirs} = [ "crypto", "ssl", "engines", "apps", "test", "util", "tools", "
# crypto/ subdirectories to build
$config{sdirs} = [
    "objects",
    "md2", "md4", "md5", "sha", "mdc2", "hmac", "ripemd", "whrlpool", "poly1305", "blake2", "siphash",
    "md2", "md4", "md5", "sha", "mdc2", "hmac", "ripemd", "whrlpool", "poly1305", "blake2", "siphash", "sm3",
    "des", "aes", "rc2", "rc4", "rc5", "idea", "aria", "bf", "cast", "camellia", "seed", "sm4", "chacha", "modes",
    "bn", "ec", "rsa", "dsa", "dh", "dso", "engine",
    "buffer", "bio", "stack", "lhash", "rand", "err",
@@ -394,6 +394,7 @@ my @disablables = (
    "seed",
    "shared",
    "siphash",
    "sm3",
    "sm4",
    "sock",
    "srp",
+3 −3
Original line number Diff line number Diff line
@@ -512,9 +512,9 @@
                   Build without support for the specified algorithm, where
                   <alg> is one of: bf, blake2, camellia, cast, chacha, cmac,
                   des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb, poly1305,
                   rc2, rc4, rmd160, scrypt, seed, siphash, sm4 or whirlpool.
                   The "ripemd" algorithm is deprecated and if used is
                   synonymous with rmd160.
				   rc2, rc4, rmd160, scrypt, seed, siphash, sm3, sm4 or
				   whirlpool.  The "ripemd" algorithm is deprecated and if used
				   is synonymous with rmd160.

  -Dxxx, lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
                   These system specific options will be recognised and
+1 −1
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ case "$GUESSOS" in
  i386-*) options="$options 386" ;;
esac

for i in aes aria bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sm4 sha
for i in aes aria bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha sm3 sm4
do
  if [ ! -d $THERE/crypto/$i ]
  then
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ SOURCE[../../libcrypto]=\
        e_rc4.c e_aes.c names.c e_seed.c e_aria.c e_sm4.c \
        e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
        m_null.c m_md2.c m_md4.c m_md5.c m_sha1.c m_wp.c \
        m_md5_sha1.c m_mdc2.c m_ripemd.c m_sha3.c \
        m_md5_sha1.c m_mdc2.c m_ripemd.c m_sha3.c m_sm3.c \
        p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
        bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
        c_allc.c c_alld.c evp_lib.c bio_ok.c \
Loading