docs: def _prep_message(self):
          """Performs initial message setup.
  
          :raises MasterKeyProviderError: if primary master key is not a member of supplied MasterKeyProvider
          :raises MasterKeyProviderError: if no Master Keys are returned from key_provider
          """
          message_id = aws_encryption_sdk.internal.utils.message_id()
  
          try:
              plaintext_length = self.stream_length
          except NotSupportedError:
              plaintext_length = None
          encryption_materials_request = EncryptionMaterialsRequest(
              algorithm=self.config.algorithm,
              encryption_context=self.config.encryption_context.copy(),
              frame_length=self.config.frame_length,
              plaintext_rostream=aws_encryption_sdk.internal.utils.streams.ROStream(self.source_stream),
              plaintext_length=plaintext_length,
          )
          self._encryption_materials = self.config.materials_manager.get_encryption_materials(
              request=encryption_materials_request
          )
  
          if self.config.algorithm is not None and self._encryption_materials.algorithm != self.config.algorithm:
              raise ActionNotAllowedError(
                  (
                      "Cryptographic materials manager provided algorithm suite"
                      " differs from algorithm suite in request.\n"
                      "Required: {requested}\n"
                      "Provided: {provided}"
                  ).format(requested=self.config.algorithm, provided=self._encryption_materials.algorithm)
              )
  
          if self._encryption_materials.signing_key is None:
              self.signer = None
          else:
              self.signer = Signer.from_key_bytes(
                  algorithm=self._encryption_materials.algorithm, key_bytes=self._encryption_materials.signing_key
              )
          aws_encryption_sdk.internal.utils.validate_frame_length(
              frame_length=self.config.frame_length, algorithm=self._encryption_materials.algorithm
          )
  
          self._derived_data_key = derive_data_encryption_key(
              source_key=self._encryption_materials.data_encryption_key.data_key,
              algorithm=self._encryption_materials.algorithm,
              message_id=message_id,
          )
  
          self._header = MessageHeader(
              version=VERSION,
              type=TYPE,
              algorithm=self._encryption_materials.algorithm,
              message_id=message_id,
              encryption_context=self._encryption_materials.encryption_context,
              encrypted_data_keys=self._encryption_materials.encrypted_data_keys,
              content_type=self.content_type,
              content_aad_length=0,
              header_iv_length=self._encryption_materials.algorithm.iv_len,
              frame_length=self.config.frame_length,
          )
          self._write_header()
          if self.content_type == ContentType.NO_FRAMING:
              self._prep_non_framed()
          self._message_prepped = True