1. Introduction:
This patch provides Demo code to add the Hisilicon hardware algorithm engine to openssl.

2. Support algorithms
Support TDES/AES symmetric encryption and decryption, HASH digest, RSA asymmetric, random number, etc., listed as follows:
        NID_aes_128_ecb,
        NID_aes_192_ecb,
        NID_aes_256_ecb,
        NID_aes_128_cbc,
        NID_aes_192_cbc,
        NID_aes_256_cbc,
        NID_aes_128_cfb128,
        NID_aes_192_cfb128,
        NID_aes_256_cfb128,
        NID_aes_128_ofb128,
        NID_aes_192_ofb128,
        NID_aes_256_ofb128,
        NID_aes_128_ctr,
        NID_aes_192_ctr,
        NID_aes_256_ctr,
        NID_des_ede3_ecb,
        NID_des_ede3_cbc,
        NID_des_ede3_cfb64,
        NID_des_ede3_ofb64,
        NID_sha1, 
        NID_sha256
        RSA1024/2048/3072/4096,
        TRNG

3. Baseline version: openssl-1.0.2l

4. Patch code description
     openssl-1.0.2l
         apps
            Makefile        //The executable file openssl compiles with linking to the Hisilicon dynamic library hi_cipher.so, etc.
         crypto
            evp
               evp_test.c  //The default engine in the EVP test case is the Hisilicon hardware algorithm engine.
            rand
                randtest.c  //The default engine in the rand test case is the Hisilicon hardware algorithm engine.
         demos
            engines
                hisilicon   //The code of Hisilicon hardware algorithm engine.
                    hi_mmz_api.h
                    hw_hisilicon.c
                    hw_hisilicon.ec
                    hw_hisilicon_err.c
                    hw_hisilicon_err.h
                    hw_hisilicon.h
                    Makefile
         test
             Makefile        //Compiling with linking to the Hisilicon dynamic library hi_cipher.so, etc.

5. Compiling
    tar -xzvf  openssl-1.0.2l.tar.gz
    cp -r pacth-hisilicon-himpp-engine/new/openssl-1.0.2l/*  openssl-1.0.2l/

    export LOCAL_OPENSSL_DIR=$(pwd)
    export CC=arm-himix200-linux-gcc
    export AR=arm-himix200-linux-ar
    export LD=arm-himix200-linux-ld
    export SDK_OUT_DIR=~/himpp_master/himpp/board/mpp/out/hi3516cv500/smp/a7_linux  //The release directory of the local SDK, should be modified according to the actual situation.

    cd openssl-1.0.2l
    ./Configure  --prefix=$LOCAL_OPENSSL_DIR/install shared linux-armv4
    
    make build_crypto
    make -C demos/engines/hisilicon gnu
    make install

    cp demos/engines/hisilicon/libhisilicon.so ../install/lib/engines/

6. Testing
    cd XXXXX/openssl                   //The storage path of openssl on the board, there is a subdirectory: install.
    export LOCAL_OPENSSL_DIR=XXXX      //This directory path must be the same as the compiling installation path LOCAL_OPENSSL_DIR.
    export BOARD_OPENSSL_DIR=$(pwd)    //The storage path of openssl on the board, that is, the parent directory of install.
    export SDK_OUT_DIR=/mnt/himpp_master/himpp/board/mpp/out/hi3516cv500/smp/a7_linux  //The release directory of the SDK on the board, should be modified according to the actual situation.

    mkdir -p $LOCAL_OPENSSL_DIR/install
    ln -s $BOARD_OPENSSL_DIR/install  $LOCAL_OPENSSL_DIR/install
    export LD_LIBRARY_PATH=/usr/local/lib:$LOCAL_OPENSSL_DIR/install/lib:$LOCAL_OPENSSL_DIR/install/lib/engines:$SDK_OUT_DIR/lib

    Running:
    //insert ko
     cd $BOARD_OPENSSL_DIR/openssl-1.0.2l/test
    ./evp_test evptests.txt
    ./randtest

    cd $BOARD_OPENSSL_DIR/install/bin
    ./openssl speed aes-128-cbc -engine hisilicon -evp aes-128-cbc
    ./openssl speed sha1 -engine hisilicon -evp sha1
    ./openssl speed rsa1024 -engine hisilicon
    ./openssl speed rsa2048 -engine hisilicon
