def algorithm_key_lengths(algorithm):
    """Return the possible key lengths for the configured algorithm."""
    from pskc.exceptions import DecryptionError
    if algorithm is None:
        raise DecryptionError('No algorithm specified')
    elif algorithm.endswith('#aes128-cbc') or algorithm.endswith('#aes192-cbc'
        ) or algorithm.endswith('#aes256-cbc'):
        return [int(algorithm[-7:-4]) // 8]
    elif algorithm.endswith('#tripledes-cbc') or algorithm.endswith(
        '#kw-tripledes'):
        return [16, 24]
    elif algorithm.endswith('#kw-aes128') or algorithm.endswith('#kw-aes192'
        ) or algorithm.endswith('#kw-aes256'):
        return [int(algorithm[-3:]) // 8]
    elif algorithm.endswith('#camellia128-cbc') or algorithm.endswith(
        '#camellia192-cbc') or algorithm.endswith('#camellia256-cbc'):
        return [int(algorithm[-7:-4]) // 8]
    elif algorithm.endswith('#kw-camellia128') or algorithm.endswith(
        '#kw-camellia192') or algorithm.endswith('#kw-camellia256'):
        return [int(algorithm[-3:]) // 8]
    else:
        raise DecryptionError('Unsupported algorithm: %r' % algorithm)
