def testConvertStringToArrayToStringCPU( self, bits ): value = random.getrandbits(bits) res_array = GF2nStub.convertStringToArray(value, BITS_PER_CHUNK) res_string = GF2nStub.convertArrayToString(res_array, BITS_PER_CHUNK) self.assertEqual(value, res_string)
def testConvertStringToArray( self, bits ): value = random.getrandbits(bits) res_cpu = GF2nStub.convertStringToArray(value, BITS_PER_CHUNK) res_ref = GF2n.convertStringToArray(value, BITS_PER_CHUNK) self.assertEqual(res_cpu, res_ref)