Ejemplo n.º 1
0
 def suite0(self):
     #for bench in ["Sha1", "Sha256","ByteSeqToWordSeq", "WordSeqToByteSeq"]:
     for bench in ["Sha256"]:
         for block_size in [32768]:
             iterations = 32768
             self.execute_test(BenchSpec(bench, iterations, 0, block_size))
     for reps in range(20):
         self.execute_test(BenchSpec("TpmExtractRandom", 1024, 1024))
Ejemplo n.º 2
0
    def suite3(self):
        #for block_size in (32,64,128,256,512,1024,2048):
        #self.execute_test(BenchSpec("RsaKeyGen", 1, block_size))
        # valid combinations: 512/32, 1024/64
        # block_size := greatest power of two less than or equal to key_size_bits/8-12.
        key_size_bits = 1024
        block_size_bytes = 64

        # create a key to encrypt against.
        self.execute_test(BenchSpec("RsaKeyGen", 1, key_size_bits, 0))
        for i in range(10):
            self.execute_test(
                BenchSpec("RsaDecrypt",
                          8,
                          key_size_bits,
                          block_size_bytes,
                          annotation="key_size_bits=%s" % key_size_bits))
            self.execute_test(
                BenchSpec("RsaEncrypt",
                          8,
                          key_size_bits,
                          block_size_bytes,
                          annotation="key_size_bits=%s" % key_size_bits))
Ejemplo n.º 3
0
 def suite2(self):
     for reps in range(20):
         self.execute_test(BenchSpec("TpmExtractRandom", 16, 1024))
Ejemplo n.º 4
0
 def suite1(self):
     for loops in range(10):
         for block_size in (512, ):
             self.execute_test(BenchSpec("RsaKeyGen", 4, block_size))