def __init__(self, mont_priv = None, mont_pub = None):
        """
        Create an XEdDSA object from Montgomery key material, to encrypt AND sign data
        using just one Montgomery key pair.

        :param mont_priv: A bytes-like object encoding the private key with length
            MONT_PRIV_KEY_SIZE or None.
        :param mont_pub: A bytes-like object encoding the public key with length
            MONT_PUB_KEY_SIZE or None.

        If both mont_priv and mont_pub are None, a new key pair is generated.
        """

        cls = self.__class__

        if not (
            isinstance(cls.MONT_PRIV_KEY_SIZE, int) and
            isinstance(cls.MONT_PUB_KEY_SIZE,  int) and
            isinstance(cls.ED_PRIV_KEY_SIZE,   int) and
            isinstance(cls.ED_PUB_KEY_SIZE,    int) and
            isinstance(cls.SIGNATURE_SIZE,     int)
        ):
            raise NotImplementedError("Can't instantiate the XEdDSA class directly.")

        if mont_priv == None and mont_pub == None:
            mont_priv = cls.generate_mont_priv()

        if not (mont_priv == None or isinstance(mont_priv, bytes)):
            raise TypeError("Wrong type passed for the mont_priv parameter.")

        if mont_priv != None and len(mont_priv) != cls.MONT_PRIV_KEY_SIZE:
            raise ValueError("Invalid value passed for the mont_priv parameter.")

        if mont_priv != None and mont_pub == None:
            mont_pub = cls.mont_pub_from_mont_priv(mont_priv)

        if not (mont_pub == None or isinstance(mont_pub, bytes)):
            raise TypeError("Wrong type passed for the mont_pub parameter.")

        if mont_pub != None and len(mont_pub) != cls.MONT_PUB_KEY_SIZE:
            raise ValueError("Invalid value passed for the mont_pub parameter.")

        self.__mont_priv = mont_priv
        self.__mont_pub  = mont_pub
def __init__ ( self , mont_priv = None , mont_pub = None ) : cls = self . __class__ if not ( isinstance ( cls . MONT_PRIV_KEY_SIZE , int ) and isinstance ( cls . MONT_PUB_KEY_SIZE , int ) and isinstance ( cls . ED_PRIV_KEY_SIZE , int ) and isinstance ( cls . ED_PUB_KEY_SIZE , int ) and isinstance ( cls . SIGNATURE_SIZE , int ) ) : raise NotImplementedError ( "Can't instantiate the XEdDSA class directly." ) if mont_priv == None and mont_pub == None : mont_priv = cls . generate_mont_priv ( ) if not ( mont_priv == None or isinstance ( mont_priv , bytes ) ) : raise TypeError ( "Wrong type passed for the mont_priv parameter." ) if mont_priv != None and len ( mont_priv ) != cls . MONT_PRIV_KEY_SIZE : raise ValueError ( "Invalid value passed for the mont_priv parameter." ) if mont_priv != None and mont_pub == None : mont_pub = cls . mont_pub_from_mont_priv ( mont_priv ) if not ( mont_pub == None or isinstance ( mont_pub , bytes ) ) : raise TypeError ( "Wrong type passed for the mont_pub parameter." ) if mont_pub != None and len ( mont_pub ) != cls . MONT_PUB_KEY_SIZE : raise ValueError ( "Invalid value passed for the mont_pub parameter." ) self . __mont_priv = mont_priv self . __mont_pub = mont_pub
Create an XEdDSA object from Montgomery key material, to encrypt AND sign data
        using just one Montgomery key pair.

        :param mont_priv: A bytes-like object encoding the private key with length
            MONT_PRIV_KEY_SIZE or None.
        :param mont_pub: A bytes-like object encoding the public key with length
            MONT_PUB_KEY_SIZE or None.

        If both mont_priv and mont_pub are None, a new key pair is generated.