anchor.diff:  	curl_absorb(Trytes, ?CURL_INITIAL_STATE).
   
   curl_absorb(<<Trytes:?TRYTE_HASHLENGTH/binary, Bin/binary>>, State) ->
  -	Trits = lists:reverse(trinary:to_trits(Trytes)),
  -	{_, Rest} = lists:split(?TRIT_HASHLENGTH, State),
  -	State0 = curl_transform(Trits ++ Rest),
  -	curl_absorb(Bin, State0);
  +	State0 = next_curl_state(Trytes, State),
  +	State1 = curl_transform(State0),
  +	curl_absorb(Bin, State1);
   curl_absorb(<<>>, State) ->
   	State.
   
  
positive.code: 	curl_squeeze(State, Count, <<>>).
  
  curl_squeeze(State, Count, Acc) when Count > 0 ->
  	{Hash, _} = lists:split(?TRIT_HASHLENGTH, State),
  	Trytes = trinary:from_trits(lists:reverse(Hash)),
  	State0 = curl_transform(State),
  	curl_squeeze(State0, Count - 1, <<Acc/binary, Trytes/binary>>);
  curl_squeeze(_, 0, Acc) ->
  
negative.code: 	X - 365.
  
  
  next_curl_state(Trytes, State) ->
  	Trits = lists:reverse(trinary:to_trits(Trytes)),
  	{_, Rest} = lists:split(?TRIT_HASHLENGTH, State),
  	Trits ++ Rest.
  
  
  get_curl_hash(Trits) ->
  	{Hash, _} = lists:split(?TRIT_HASHLENGTH, Trits),
  	trinary:from_trits(lists:reverse(Hash)).
  
  
  bcurlt(HighTrytes, LowTrytes) ->
  	bcurlt(HighTrytes, LowTrytes, 1).
  
  