tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

kbkdf.sh (1238B)


      1 #!/bin/sh
      2 #
      3 # This Source Code Form is subject to the terms of the Mozilla Public
      4 # License, v. 2.0. If a copy of the MPL was not distributed with this
      5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      6 #
      7 # A Bourne shell script for running the NIST SHA Algorithm Validation Suite
      8 #
      9 # Before you run the script, set your PATH, LD_LIBRARY_PATH, ... environment
     10 # variables appropriately so that the fipstest command and the NSPR and NSS
     11 # shared libraries/DLLs are on the search path.  Then run this script in the
     12 # directory where the REQUEST (.req) files reside.  The script generates the
     13 # RESPONSE (.rsp) files in the same directory.
     14 BASEDIR=${1-.}
     15 TESTDIR=${BASEDIR}/KBKDF
     16 COMMAND=${2-run}
     17 REQDIR=${TESTDIR}/req
     18 RSPDIR=${TESTDIR}/resp
     19 
     20 all_requests="
     21 KBKDFCounter.req
     22 "
     23 
     24 if [ ${COMMAND} = "verify" ]; then
     25    result=0
     26    for request in $all_requests; do
     27        sh ./validate1.sh ${TESTDIR} $request
     28        last_result=$?
     29        result=`expr $result + $last_result`
     30    done
     31    exit $result
     32 fi
     33 
     34 test -d "${RSPDIR}" || mkdir "${RSPDIR}"
     35 
     36 for request in $all_requests; do
     37    response=`echo $request | sed -e "s/req/rsp/"`
     38    echo $request $response
     39    fipstest kbkdf ${REQDIR}/$request > ${RSPDIR}/$response
     40 done
     41 exit 0