async def _genContxt(self, schemaId: ID, iA, userId): iA = strToInt(str(iA)) userId = strToInt(str(userId)) S = iA | userId H = get_hash_as_int(S) m2 = cmod.integer(H % (2**LARGE_MASTER_SECRET)) await self.wallet.submitContextAttr(schemaId, m2) return m2
def _get_hash(self, CList, TauList, nonce): return get_hash_as_int(nonce, *reduce(lambda x, y: x + y, [TauList, CList]))
def _checkHashEqual(input): h1 = get_hash_as_int(*input) h2 = get_hash_as_int(*reversed(input)) assert h1 == h2