File: test.sh

package info (click to toggle)
python-argon2 18.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,468 kB
  • sloc: ansic: 3,715; python: 1,328; makefile: 307; sh: 55
file content (49 lines) | stat: -rwxr-xr-x 696 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

for opttest in "" "OPTTEST=1"
do
  if [ "" = "$opttest" ]
  then
    printf "Default build\n"
  else
    printf "Force OPTTEST=1\n"
  fi

  make genkat $opttest > /dev/null
  if [ $? -ne 0 ]
  then
    exit $?
  fi

  i=0
  for version in 16 19
  do
    for type in i d id
    do
      i=$(($i+1))

      printf "argon2$type v=$version: "

      if [ 19 -eq $version ]
      then
        kats="kats/argon2"$type
      else
        kats="kats/argon2"$type"_v"$version
      fi

      ./genkat $type $version > tmp
      if diff tmp $kats
      then
        printf "OK"
      else
        printf "ERROR"
        exit $i
      fi
      printf "\n"
    done
  done
done

rm -f tmp

exit 0