code: def genKw(w,msk,z):
      
      # Hash inputs into a string of bytes
      b = hmac(msk, z + w, tag="TAG_PYTHIA_KW")
  
      # Convert the string into a long value (no larger than the order of Gt),
      # then return a BigInt value.
      return BigInt(longFromString(b) % long(orderGt()))
docs: Generates key Kw using key-selector @w, master secret key @msk, and
      table value @z.
      @returns Kw as a BigInt.