Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def split(self, data, m, n):
if not len(data) in self.primes.keys():
raise Exception('Unknown data length')
if m < 2 or m > 15:
raise Exception('Invalid M provided')
if n < 2 or n > 15:
raise Exception('Invalid N provided')
prime = self.primes[len(data)]
s = secret_int_to_points(int(binascii.hexlify(data), 16), m, n, prime)
s = ['%x%x%s' % (m, x[0], ('%x' % x[1]).zfill(len(data) * 2)) for x in s]
return [self.mnemo.to_mnemonic(binascii.unhexlify(x)) for x in s]