]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/feeCurve
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / cspxutils / feeCurve
1 #! /bin/csh -f
2 #
3 # run FEE tests for CSP/X for one curve. All incoming arguments except for 's'
4 # passed down to individual tests. It's assumed thast one of the arguments is
5 # "C=m" for Montgomery curves; in that case we skip the Weierstrass-only tests.
6 #
7 set BUILD_DIR=$LOCAL_BUILD_DIR
8 #
9 set QUICK_TEST=0
10 set CMD_ARGS=
11 set WEIERSTRASS=1
12 #
13 while ( $#argv > 0 )
14 switch ( "$argv[1]" )
15 case s:
16 set QUICK_TEST = 1
17 shift
18 breaksw
19 default:
20 if("$argv[1]" == "C=m") then
21 set WEIERSTRASS = 0
22 endif
23 set CMD_ARGS = "$CMD_ARGS $argv[1]"
24 shift
25 breaksw
26 endsw
27 end
28 #
29 # Select 'quick' or 'normal' test params
30 #
31 if($QUICK_TEST == 1) then
32 set SIGTEST_ARGS=
33 set BADSIG_ARGS="l=4 i=10"
34 set ASYMTEST_ARGS=
35 else
36 set SIGTEST_ARGS=
37 set BADSIG_ARGS="l=20"
38 set ASYMTEST_ARGS=
39 endif
40 #
41 cd $BUILD_DIR
42 #
43 # sigtest - FEE/MD5, FEE/SHA1 for all curves; ECDSA for Weierstrass only
44 #
45 sigtest a=f $SIGTEST_ARGS $CMD_ARGS || exit(1)
46 sigtest a=F $SIGTEST_ARGS $CMD_ARGS || exit(1)
47 if($WEIERSTRASS == 1) then
48 sigtest a=e $SIGTEST_ARGS $CMD_ARGS || exit(1)
49 endif
50 #
51 # badsig - FEE/MD5, FEE/SHA1 for all curves; ECDSA for Weierstrass only
52 #
53 badsig a=f $BADSIG_ARGS $CMD_ARGS || exit(1)
54 badsig a=F $BADSIG_ARGS $CMD_ARGS || exit(1)
55 if($WEIERSTRASS == 1) then
56 badsig a=e $BADSIG_ARGS $CMD_ARGS || exit(1)
57 endif
58 #
59 # asymtest - FEED, FEEDExp for all curves
60 #
61 asymTest a=f $ASYMTEST_ARGS $CMD_ARGS || exit(1)
62 asymTest a=x $ASYMTEST_ARGS $CMD_ARGS || exit(1)