def split(secret, m, n)
      prime = @order
      secret_num = int_from_be(secret)
      if secret_num >= @order
        raise "Secret cannot be encoded with #{@bitlength}-bit SSSS"
      end
      if !(n >= 1 && n <= 16)
        raise "N must be between 1 and 16"
      end
      if !(m >= 1 && m <= n)
        raise "M must be between 1 and N"
      end
      shares = []
      coef = [secret_num] # polynomial coefficients
      (m - 1).times do |i|
        # Generate unpredictable yet deterministic coefficients for each secret and M.
        coef << int_from_be(prng(secret + m.chr + i.chr))
      end
      n.times do |i|
        x = i + 1
        exp = 1
        y = coef[0]
        while exp < m
          y = (y + (coef[exp] * ((x**exp) % prime) % prime)) % prime
          exp += 1
        end
        # Encode share
        shares << string_from_point(m, x, y)
      end
      shares
    end
def split(secret, m, n)
      prime = @order
      secret_num = int_from_be(secret)
      if secret_num >= @order
        raise "Secret cannot be encoded with #{@bitlength}-bit SSSS"
      end
      if !(n >= 1 && n <= 16)
        raise "N must be between 1 and 16"
      end
      if !(m >= 1 && m <= n)
        raise "M must be between 1 and N"
      end
      shares = []
      coef = [secret_num] # polynomial coefficients
      (m - 1).times do |i|
        # Generate unpredictable yet deterministic coefficients for each secret and M.
        coef << int_from_be(prng(secret + m.chr + i.chr))
      end
      n.times do |i|
        x = i + 1
        exp = 1
        y = coef[0]
        while exp < m
          y = (y + (coef[exp] * ((x**exp) % prime) % prime)) % prime
          exp += 1
        end
        # Encode share
        shares << string_from_point(m, x, y)
      end
      shares
    end
Returns N strings, any M of them are enough to retrieve a secret.
 Each string encodes X and Y coordinates and also M. X & M takes one byte, Y takes 16 bytes:
 MMMMXXXX YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY