示例#1
0
 def test_fake_prf_set_success(self):
     prf_set = helper.FakePrfSet('Name')
     output_primary = prf_set.primary().compute(b'input', output_length=31)
     self.assertLen(output_primary, 31)
     prfs = prf_set.all()
     self.assertLen(prfs, 1)
     output = prfs[0].compute(b'input', output_length=31)
     self.assertLen(output, 31)
示例#2
0
 def new_primitive_key_pair(self, key_id):
     fake_key = helper.fake_key(key_id=key_id,
                                output_prefix_type=tink_pb2.RAW)
     fake_prf_set = helper.FakePrfSet('fakePrfSet {}'.format(key_id))
     return fake_prf_set, fake_key