anchor.diff:  	_ -> throw(trailing_garbage)
       end.
   
  +new_compmap() -> gb_trees:empty().
  +
   %% @private
   encode_dname(Name) ->
       Labels = << <<(byte_size(L)), L/binary>> || L <- dname_to_labels(Name) >>,
  
positive.code: 	_ -> throw(no_tsig)
      end.
  
  gen_tsig_mac(Alg, MsgBin, Name, Secret, Time, Fudge, ErrorCode, Other, PMAC) ->
      NameBin = encode_dname(dname_to_lower(Name)),
      AlgBin = encode_dname(dname_to_lower(Alg)),
      OtherLen = byte_size(Other),
      Base = case PMAC of
  	       <<>> -> <<>>;
  	       PMAC ->
  		   PMACLen = byte_size(PMAC),
  		   <<PMACLen:16, PMAC/binary>>
  	   end,
      MACData = [Base, MsgBin, NameBin, <<?DNS_CLASS_ANY:16>>, <<0:32>>, AlgBin,
  	       <<Time:48>>, <<Fudge:16>>, <<ErrorCode:16>>, <<OtherLen:16>>,
  	       Other],
      case dname_to_lower(iolist_to_binary(Alg)) of
  	?DNS_TSIG_ALG_MD5 -> {ok, crypto:md5_mac(Secret, MACData)};
  	?DNS_TSIG_ALG_SHA1 -> {ok, crypto:sha_mac(Secret, MACData)};
  	?DNS_TSIG_ALG_SHA224 -> {ok, sha2:hmac_sha224(Secret, MACData)};
  	?DNS_TSIG_ALG_SHA256 -> {ok, sha2:hmac_sha256(Secret, MACData)};
  	?DNS_TSIG_ALG_SHA384 -> {ok, sha2:hmac_sha384(Secret, MACData)};
  	?DNS_TSIG_ALG_SHA512 -> {ok, sha2:hmac_sha512(Secret, MACData)};
  	_ -> {error, ?DNS_TSIGERR_BADKEY}
      end.
  
  %%%===================================================================
  
negative.code: 	ANC:16, AUC:16, ADC:16, HRB/binary>> = MsgBin) ->
      UnsignedADC = ADC - 1,
      {_Questions, QRB} = decode_message_questions(HRB, QC, MsgBin),
      {_Answers, TSIGBin} =
  	decode_message_body(QRB, ANC + AUC + UnsignedADC, MsgBin),
      case decode_message_body(TSIGBin, 1, MsgBin) of
  	{[#dns_rr{data = #dns_rrdata_tsig{msgid = NewId}} = TSIG_RR], <<>>} ->
  	    MsgBodyLen = byte_size(HRB) - byte_size(TSIGBin),
  