anchor.diff:    end;
   end;
   
  -function TCShake.BytePad(const AInput: THashLibByteArray; AW: Int32)
  +// class function TCShake.RightEncode(AInput: UInt64): THashLibByteArray;
  +// var
  +// LN: Byte;
  +// LV: UInt64;
  +// LIdx: Int32;
  +// begin
  +// LN := 1;
  +// LV := AInput;
  +// LV := LV shr 8;
  +//
  +// while (LV <> 0) do
  +// begin
  +// System.Inc(LN);
  +// LV := LV shr 8;
  +// end;
  +//
  +// System.SetLength(Result, LN + 1);
  +// Result[LN] := LN;
  +// for LIdx := 1 to LN do
  +// begin
  +// Result[LIdx - 1] := Byte(AInput shr (8 * (LN - LIdx)));
  +// end;
  +// end;
  +
  +class function TCShake.BytePad(const AInput: THashLibByteArray; AW: Int32)
     : THashLibByteArray;
   var
     LBuffer: THashLibByteArray;
     LPadLength: Int32;
   begin
  -  // LeftEncode always returns max 9 bytes
  -  LBuffer := Nil;
  -  LBuffer := TArrayUtils.Concatenate(LBuffer, LeftEncode(UInt64(AW)));
  -  LBuffer := TArrayUtils.Concatenate(LBuffer, AInput);
  -
  +  LBuffer := TArrayUtils.Concatenate(LeftEncode(UInt64(AW)), AInput);
     LPadLength := AW - (System.Length(LBuffer) mod AW);
     System.SetLength(Result, LPadLength);
     Result := TArrayUtils.Concatenate(LBuffer, Result);
   end;
   
  +class function TCShake.EncodeString(const AInput: THashLibByteArray)
  +  : THashLibByteArray;
  +begin
  +  if System.Length(AInput) = 0 then
  +  begin
  +    Result := LeftEncode(0);
  +    Exit;
  +  end;
  +  Result := TArrayUtils.Concatenate(LeftEncode(UInt64(System.Length(AInput) * 8)
  +    ), AInput);
  +end;
  +
   constructor TCShake.Create(AHashSize: THashSize; const N, S: THashLibByteArray);
   begin
     Inherited Create(AHashSize);
  
positive.code: 
  { TCShake }
  
  function TCShake.LeftEncode(AInput: UInt64): THashLibByteArray;
  var
    LN: Byte;
    LV: UInt64;
  
negative.code: 
    strict private
  
      // LeftEncode returns max 9 bytes
      class function LeftEncode(AInput: UInt64): THashLibByteArray; static;
      // class function RightEncode(AInput: UInt64): THashLibByteArray; static;
      class function BytePad(const AInput: THashLibByteArray; AW: Int32)
        : THashLibByteArray; static;
      class function EncodeString(const AInput: THashLibByteArray)
        : THashLibByteArray; static;
  
    protected
  
  