def __init__(
        self,
        algorithm_id,  # type: int
        encryption,  # type: EncryptionSuite
        kdf=KDFSuite.NONE,  # type: Optional[KDFSuite]
        authentication=AuthenticationSuite.NONE,  # type: Optional[AuthenticationSuite]
        allowed=True,  # type: bool
    ):
        # type: (...) -> None
        """Prepare a new AlgorithmSuite."""
        self.algorithm_id = algorithm_id
        self.encryption = encryption
        self.encryption.valid_kdf(kdf)
        self.kdf = kdf
        self.authentication = authentication
        self.allowed = allowed

        # Encryption Values
        self.encryption_algorithm = self.encryption.algorithm
        self.encryption_mode = self.encryption.mode
        self.data_key_len = self.encryption.data_key_length
        self.iv_len = self.encryption.iv_length
        self.auth_key_len = self.encryption.auth_key_length
        self.auth_len = self.tag_len = self.encryption.auth_length

        # KDF Values
        self.kdf_type = self.kdf.algorithm
        self.kdf_hash_type = self.kdf.hash_algorithm

        # Authentication Values
        self.signing_algorithm_info = self.authentication.algorithm
        self.signing_hash_type = self.authentication.hash_algorithm
        self.signature_len = self.authentication.signature_length

        self.__rlookup__[algorithm_id] = self
def __init__ ( self , algorithm_id , encryption , kdf = KDFSuite . NONE , authentication = AuthenticationSuite . NONE , allowed = True , ) : self . algorithm_id = algorithm_id self . encryption = encryption self . encryption . valid_kdf ( kdf ) self . kdf = kdf self . authentication = authentication self . allowed = allowed self . encryption_algorithm = self . encryption . algorithm self . encryption_mode = self . encryption . mode self . data_key_len = self . encryption . data_key_length self . iv_len = self . encryption . iv_length self . auth_key_len = self . encryption . auth_key_length self . auth_len = self . tag_len = self . encryption . auth_length self . kdf_type = self . kdf . algorithm self . kdf_hash_type = self . kdf . hash_algorithm self . signing_algorithm_info = self . authentication . algorithm self . signing_hash_type = self . authentication . hash_algorithm self . signature_len = self . authentication . signature_length self . __rlookup__ [ algorithm_id ] = self
Prepare a new AlgorithmSuite.