• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10if [ -z "$1" ] || [ ! -d "$1" ]; then
11  echo "The directory of files to process must be supplied as an argument."
12  exit 1
13fi
14
15cat "$1"/CBC*.rsp | ./parse_records.py > aes-cbc.csv
16cat "$1"/CFB8*.rsp | ./parse_records.py > aes-cfb8.csv
17cat "$1"/CFB128*.rsp | ./parse_records.py > aes-cfb128.csv
18cat "$1"/ECB*.rsp | ./parse_records.py > aes-ecb.csv
19cat "$1"/OFB*.rsp | ./parse_records.py > aes-ofb.csv
20cat "$1"/TCBC*.rsp | ./parse_records.py > desede-cbc.csv
21cat "$1"/TCFB8*.rsp | ./parse_records.py > desede-cfb8.csv
22cat "$1"/TCFB64*.rsp | ./parse_records.py > desede-cfb64.csv
23cat "$1"/TECB*.rsp | ./parse_records.py > desede-ecb.csv
24cat "$1"/TOFB*.rsp | ./parse_records.py > desede-ofb.csv
25cat "$1"/gcm*.rsp | ./parse_records.py > aes-gcm.csv
26# ChaCha20 vectors come from RFC drafts, so they don't need the NIST header
27cat "$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
29cat "$1"/chacha20-poly1305.rsp | ./parse_records.py --noheader > chacha20-poly1305.csv
30