anchor.diff:  tls_or_dtls(_) ->
       tls.
   
  +hexstr2int(S) ->
  +    B = hexstr2bin(S),
  +    Bits = size(B) * 8,
  +    <<Integer:Bits/integer>> = B,
  +    Integer.
  +
   hexstr2bin(S) when is_binary(S) ->
  -    list_to_binary(hexstr2list(binary_to_list(S)));
  +    hexstr2bin(S, <<>>);
   hexstr2bin(S) ->
  -    list_to_binary(hexstr2list(S)).
  -
  -hexstr2list([$ |T]) ->
  -    hexstr2list(T);
  -hexstr2list([X,Y|T]) ->
  -    [mkint(X)*16 + mkint(Y) | hexstr2list(T)];
  -hexstr2list([]) ->
  -    [].
  -
  -mkint(C) when $0 =< C, C =< $9 ->
  +    hexstr2bin(list_to_binary(S), <<>>).
  +%%
  +hexstr2bin(<<>>, Acc) ->
  +    Acc;
  +hexstr2bin(<<C,T/binary>>, Acc) when C =:= 32;   %% SPACE
  +                                     C =:= 10;   %% LF
  +                                     C =:= 13 -> %% CR
  +    hexstr2bin(T, Acc);
  +hexstr2bin(<<X,Y,T/binary>>, Acc) ->
  +    I = hex2int(X) * 16 + hex2int(Y),
  +    hexstr2bin(T, <<Acc/binary,I>>).
  +
  +hex2int(C) when $0 =< C, C =< $9 ->
       C - $0;
  -mkint(C) when $A =< C, C =< $F ->
  +hex2int(C) when $A =< C, C =< $F ->
       C - $A + 10;
  -mkint(C) when $a =< C, C =< $f ->
  +hex2int(C) when $a =< C, C =< $f ->
       C - $a + 10.
  
positive.code:     Content = <<Label/binary, Context/binary>>,
      Len = size(Content),
      HkdfLabel = <<?UINT16(32), Content/binary>>.
  
  
  
  %%--------------------------------------------------------------------
  
negative.code:     %%    public key (32 octets):  99 38 1d e5 60 e4 bd 43 d2 3d 8e 43 5a 7d
      %%       ba fe b3 c0 6e 51 c1 3c ae 4d 54 13 69 1e 52 9a af 2c
      CPublicKey =
          hexstr2bin("99 38 1d e5 60 e4 bd 43 d2 3d 8e 43 5a 7d
            ba fe b3 c0 6e 51 c1 3c ae 4d 54 13 69 1e 52 9a af 2c"),
  
      %% {server}  create an ephemeral x25519 key pair:
      %%
  