anchor.diff:      end.
   
   crypto_supported(Conditions, Supported) ->
  -    lists:all( fun({Tag,CryptoName}) ->
  -		       lists:member(CryptoName, proplists:get_value(Tag,Supported,[]))
  +    lists:all( fun({Tag,CryptoName}) when is_atom(CryptoName) ->
  +		       crypto_name_supported(Tag,CryptoName,Supported);
  +		  ({Tag,{Name=aes_ctr,Len}}) when is_integer(Len) ->
  +		       crypto_name_supported(Tag,Name,Supported) andalso
  +			   ctr_len_supported(Name,Len)
   	       end, Conditions).
   
  +crypto_name_supported(Tag, CryptoName, Supported) ->
  +    lists:member(CryptoName, proplists:get_value(Tag,Supported,[])).
  +
  +ctr_len_supported(Name, Len) ->
  +    try
  +	crypto:stream_encrypt(crypto:stream_init(Name, <<0:Len>>, <<0:128>>), <<"">>)
  +    of
  +	{_,X} -> is_binary(X)
  +    catch
  +	_:_ -> false
  +    end.
  +	    
   
   same(Algs) ->  [{client2server,Algs}, {server2client,Algs}].
   
  
positive.code:     {Ssh, list_to_binary(Decompressed)}.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% MAC calculation
  %%
  %%     hmac-sha1    REQUIRED        HMAC-SHA1 (digest length = key
  %%                                  length = 20)
  %%     hmac-sha1-96 RECOMMENDED     first 96 bits of HMAC-SHA1 (digest
  %%                                  length = 12, key length = 20)
  %%     hmac-md5     OPTIONAL        HMAC-MD5 (digest length = key
  %%                                  length = 16)
  %%     hmac-md5-96  OPTIONAL        first 96 bits of HMAC-MD5 (digest
  %%                                  length = 12, key length = 16)
  %%     none         OPTIONAL        no MAC; NOT RECOMMENDED
  %%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  
negative.code:       [
         {'ecdh-sha2-nistp256',                   [{public_keys,ecdh}, {ec_curve,secp256r1}, {hashs,sha256}]},
         {'ecdh-sha2-nistp384',                   [{public_keys,ecdh}, {ec_curve,secp384r1}, {hashs,sha384}]},
         {'diffie-hellman-group14-sha1',          [{public_keys,dh},   {hashs,sha}]},
         {'diffie-hellman-group-exchange-sha256', [{public_keys,dh},   {hashs,sha256}]},
         {'diffie-hellman-group-exchange-sha1',   [{public_keys,dh},   {hashs,sha}]},
         {'ecdh-sha2-nistp521',                   [{public_keys,ecdh}, {ec_curve,secp521r1}, {hashs,sha512}]},
         {'diffie-hellman-group1-sha1',           [{public_keys,dh},   {hashs,sha}]}
        ]);
  supported_algorithms(public_key) ->
      ssh_auth:default_public_key_algorithms();
  supported_algorithms(cipher) ->
      same(
        select_crypto_supported(
  	[{'aes256-ctr', [{ciphers,{aes_ctr,256}}]},
  	 {'aes192-ctr', [{ciphers,{aes_ctr,192}}]},
  	 {'aes128-ctr', [{ciphers,{aes_ctr,128}}]},
  	 {'aes128-cbc', [{ciphers,aes_cbc128}]},
  	 {'3des-cbc',   [{ciphers,des3_cbc}]}
  	]
  