Home | History | Annotate | Download | only in crypto
      1 #!/usr/bin/env bash
      2 #
      3 # Writes out all CSV files for crypto test data based on NIST test vectors.
      4 #
      5 # NIST vectors can be obtained from
      6 # http://csrc.nist.gov/groups/STM/cavp/block-ciphers.html#test-vectors
      7 #
      8 # BoringSSL vectors can be obtained from their source under crypto/cipher_extra/test
      9 
     10 if [ -z "$1" ] || [ ! -d "$1" ]; then
     11   echo "The directory of files to process must be supplied as an argument."
     12   exit 1
     13 fi
     14 
     15 cat "$1"/CBC*.rsp | ./parse_records.py > aes-cbc.csv
     16 cat "$1"/CFB8*.rsp | ./parse_records.py > aes-cfb8.csv
     17 cat "$1"/CFB128*.rsp | ./parse_records.py > aes-cfb128.csv
     18 cat "$1"/ECB*.rsp | ./parse_records.py > aes-ecb.csv
     19 cat "$1"/OFB*.rsp | ./parse_records.py > aes-ofb.csv
     20 cat "$1"/TCBC*.rsp | ./parse_records.py > desede-cbc.csv
     21 cat "$1"/TCFB8*.rsp | ./parse_records.py > desede-cfb8.csv
     22 cat "$1"/TCFB64*.rsp | ./parse_records.py > desede-cfb64.csv
     23 cat "$1"/TECB*.rsp | ./parse_records.py > desede-ecb.csv
     24 cat "$1"/TOFB*.rsp | ./parse_records.py > desede-ofb.csv
     25 cat "$1"/gcm*.rsp | ./parse_records.py > aes-gcm.csv
     26 # ChaCha20 vectors come from RFC drafts, so they don't need the NIST header
     27 cat "$1"/chacha20-cipher*.rsp | ./parse_records.py --noheader > chacha20.csv
     28 # ChaCha20-Poly1305 vectors come from BoringSSL, so they don't need the NIST header
     29 cat "$1"/chacha20-poly1305.rsp | ./parse_records.py --noheader > chacha20-poly1305.csv
     30