anchor.diff:  
   dh_gex_group_sizes()->
       [KeyLen || {KeyLen,_} <- ?dh_default_groups].
  +
  +
  +%%--------------------------------------------------------------------
  +%%% Internal functions
  +%%--------------------------------------------------------------------
   
   %% Select the one with K closest to N but within the interval [Min,Max]
       
  
positive.code: %%
  -module(pubkey_ssh).
  
  -include("public_key.hrl").
  -include("pubkey_moduli.hrl").
  
  
  -export([decode/2, encode/2,
  	 dh_gex_group/4, 
  	 dh_gex_group_sizes/0,
  pad/2,         new_openssh_encode/1, new_openssh_decode/1  % For test and experiments
  	]).
  
  -define(UINT32(X), X:32/unsigned-big-integer).
  -define(STRING(X), ?UINT32((byte_size(X))), (X)/binary).
  
  -define(DEC_BIN(X,Len),   ?UINT32(Len), X:Len/binary ).
  -define(DEC_MPINT(I,Len), ?DEC_INT(I,Len) ).
  -define(DEC_INT(I,Len),   ?UINT32(Len), I:Len/big-signed-integer-unit:8 ).
  
  -define(Empint(X),  (mpint(X))/binary ).
  -define(Estring(X), (string(X))/binary ).
  
  -define(b64enc(X), base64:encode(iolist_to_binary(X)) ).
  -define(b64mime_dec(X), base64:mime_decode(iolist_to_binary(X)) ).
  
  %% Max encoded line length is 72, but conformance examples use 68
  %% Comment from rfc 4716: "The following are some examples of public
  %% key files that are compliant (note that the examples all wrap
  %% before 72 bytes to meet IETF document requirements; however, they
  %% are still compliant.)" So we choose to use 68 also.
  -define(ENCODED_LINE_LENGTH, 68).
  
  
  %%====================================================================
  %% Internal application API
  %%====================================================================
  
  %%--------------------------------------------------------------------
  %% Description: Decodes a ssh file-binary.
  %%--------------------------------------------------------------------
  decode(Bin, public_key)->
      PKtype =
          case binary:match(Bin, begin_marker()) of
              nomatch -> openssh_public_key;
              _ -> rfc4716_public_key
          end,
      decode(Bin, PKtype);
  decode(Bin, rfc4716_public_key) ->
      rfc4716_decode(Bin);
  decode(Bin, ssh2_pubkey) ->
      ssh2_pubkey_decode(Bin);
  decode(Bin, new_openssh) ->
      new_openssh_decode(Bin);
  decode(Bin, Type) ->
      openssh_decode(Bin, Type).
  
  %%--------------------------------------------------------------------
  %% Description: Encodes a list of ssh file entries.
  %%--------------------------------------------------------------------
  encode(Bin, ssh2_pubkey) ->
      ssh2_pubkey_encode(Bin);
  encode(Entries, Type) ->
      iolist_to_binary(lists:map(fun({Key, Attributes}) ->
  					      do_encode(Type, Key, Attributes)
  				      end, Entries)).
  
  %%--------------------------------------------------------------------
  %% Description: Returns Generator and Modulus given MinSize, WantedSize
  
negative.code: select_by_keylen(_Min, _N, _Max, [],GPprev) ->
      %% is between Min and Max
      GPprev.
  