summaryrefslogtreecommitdiff
path: root/mach
diff options
context:
space:
mode:
authorJonas Allmann <jallmann@mozilla.com>2018-12-11 11:45:58 +0100
committerJonas Allmann <jallmann@mozilla.com>2018-12-11 11:45:58 +0100
commitb1325f0077b76d76be5b0a3ac7ee531be594ce6f (patch)
treec5802d8395c548fd5d62c87798d06cac46bec969 /mach
parent19d702fb2dd583b461f59459da208f253eda3e96 (diff)
downloadnss-hg-b1325f0077b76d76be5b0a3ac7ee531be594ce6f.tar.gz
Bug 1508666 - AES-GCM Wycheproof testcases, r=franziskus
This patch also introduces the ./mach wycheproof command to update wycheproof test cases. Differential Revision: https://phabricator.services.mozilla.com/D12559
Diffstat (limited to 'mach')
-rwxr-xr-xmach29
1 files changed, 29 insertions, 0 deletions
diff --git a/mach b/mach
index 178cfeb74..46b3ad7b1 100755
--- a/mach
+++ b/mach
@@ -17,6 +17,7 @@ import platform
import tempfile
from hashlib import sha256
+from gtests.common.wycheproof.genaesgcm import generate_aes_gcm
DEVNULL = open(os.devnull, 'wb')
cwd = os.path.dirname(os.path.abspath(__file__))
@@ -212,6 +213,22 @@ class commandsAction(argparse.Action):
for c in commandsAction.commands:
print(c)
+class wycheproofAction(argparse.Action):
+ tests = ['aes_gcm_test.json']
+
+ def __call__(self, parser, args, values, option_string=None):
+ self.update_tests()
+ generate_aes_gcm()
+ clangFormat = cfAction(None, None, None)
+ clangFormat(None, args, None)
+
+ def update_tests(self):
+ remote = "https://raw.githubusercontent.com/google/wycheproof/master/testvectors/"
+ for test in self.tests:
+ subprocess.check_call(['wget', remote+test, '-O',
+ 'gtests/common/wycheproof/testvectors/'+test,
+ '--no-check-certificate'])
+
def parse_arguments():
parser = argparse.ArgumentParser(
@@ -270,6 +287,18 @@ def parse_arguments():
nargs='*',
action=commandsAction)
+ parser_wycheproof = subparsers.add_parser(
+ 'wycheproof',
+ help="generate wycheproof test headers")
+ parser_wycheproof.add_argument(
+ '--noroot',
+ help='On linux, suppress the use of \'sudo\' for running docker.',
+ action='store_true')
+ parser_wycheproof.add_argument(
+ 'wycheproof',
+ nargs='*',
+ action=wycheproofAction)
+
commandsAction.commands = [c for c in subparsers.choices]
return parser.parse_args()