code: def deserialize_encryption_context(serialized_encryption_context):
      
      if len(serialized_encryption_context) > aws_encryption_sdk.internal.defaults.MAX_BYTE_ARRAY_SIZE:
          raise SerializationError("Serialized context is too long.")
  
      if serialized_encryption_context == b"":
          _LOGGER.debug("No encryption context data found")
          return {}
  
      deserialized_size = 0
      encryption_context = {}
  
      dict_size, deserialized_size = read_short(source=serialized_encryption_context, offset=deserialized_size)
      _LOGGER.debug("Found %d keys", dict_size)
      for _ in range(dict_size):
          key_size, deserialized_size = read_short(source=serialized_encryption_context, offset=deserialized_size)
          key, deserialized_size = read_string(
              source=serialized_encryption_context, offset=deserialized_size, length=key_size
          )
          value_size, deserialized_size = read_short(source=serialized_encryption_context, offset=deserialized_size)
          value, deserialized_size = read_string(
              source=serialized_encryption_context, offset=deserialized_size, length=value_size
          )
          if key in encryption_context:
              raise SerializationError("Duplicate key in serialized context.")
          encryption_context[key] = value
  
      if deserialized_size != len(serialized_encryption_context):
          raise SerializationError("Formatting error: Extra data in serialized context.")
  
      return encryption_context
docs: Deserializes the contents of a byte string into a dictionary.
  
      :param bytes serialized_encryption_context: Source byte string containing serialized dictionary
      :returns: Deserialized encryption context
      :rtype: dict
      :raises SerializationError: if serialized encryption context is too large
      :raises SerializationError: if duplicate key found in serialized encryption context
      :raises SerializationError: if malformed data found in serialized encryption context