@@ -141,7 +141,7 @@ public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outl
141141
142142 _encCircularBuffer . Put ( buf , 0 , length ) ;
143143 outlength = 0 ;
144- logger . Debug ( "---Start Encryption" ) ;
144+ logger . Trace ( "---Start Encryption" ) ;
145145 if ( ! _encryptSaltSent ) {
146146 _encryptSaltSent = true ;
147147 // Generate salt
@@ -150,7 +150,7 @@ public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outl
150150 InitCipher ( saltBytes , true , false ) ;
151151 Array . Copy ( saltBytes , 0 , outbuf , 0 , saltLen ) ;
152152 outlength = saltLen ;
153- logger . Debug ( $ "_encryptSaltSent outlength { outlength } ") ;
153+ logger . Trace ( $ "_encryptSaltSent outlength { outlength } ") ;
154154 }
155155
156156 if ( ! _tcpRequestSent ) {
@@ -163,7 +163,7 @@ public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outl
163163 Debug . Assert ( encAddrBufLength == AddrBufLength + tagLen * 2 + CHUNK_LEN_BYTES ) ;
164164 Array . Copy ( encAddrBufBytes , 0 , outbuf , outlength , encAddrBufLength ) ;
165165 outlength += encAddrBufLength ;
166- logger . Debug ( $ "_tcpRequestSent outlength { outlength } ") ;
166+ logger . Trace ( $ "_tcpRequestSent outlength { outlength } ") ;
167167 }
168168
169169 // handle other chunks
@@ -178,15 +178,15 @@ public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outl
178178 Debug . Assert ( encChunkLength == chunklength + tagLen * 2 + CHUNK_LEN_BYTES ) ;
179179 Buffer . BlockCopy ( encChunkBytes , 0 , outbuf , outlength , encChunkLength ) ;
180180 outlength += encChunkLength ;
181- logger . Debug ( "chunks enc outlength " + outlength ) ;
181+ logger . Trace ( "chunks enc outlength " + outlength ) ;
182182 // check if we have enough space for outbuf
183183 if ( outlength + TCPHandler . ChunkOverheadSize > TCPHandler . BufferSize ) {
184- logger . Debug ( "enc outbuf almost full, giving up" ) ;
184+ logger . Trace ( "enc outbuf almost full, giving up" ) ;
185185 return ;
186186 }
187187 bufSize = ( uint ) _encCircularBuffer . Size ;
188188 if ( bufSize <= 0 ) {
189- logger . Debug ( "No more data to encrypt, leaving" ) ;
189+ logger . Trace ( "No more data to encrypt, leaving" ) ;
190190 return ;
191191 }
192192 }
@@ -201,7 +201,7 @@ public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outl
201201 // drop all into buffer
202202 _decCircularBuffer . Put ( buf , 0 , length ) ;
203203
204- logger . Debug ( "---Start Decryption" ) ;
204+ logger . Trace ( "---Start Decryption" ) ;
205205 if ( ! _decryptSaltReceived ) {
206206 bufSize = _decCircularBuffer . Size ;
207207 // check if we get the leading salt
@@ -212,15 +212,15 @@ public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outl
212212 _decryptSaltReceived = true ;
213213 byte [ ] salt = _decCircularBuffer . Get ( saltLen ) ;
214214 InitCipher ( salt , false , false ) ;
215- logger . Debug ( "get salt len " + saltLen ) ;
215+ logger . Trace ( "get salt len " + saltLen ) ;
216216 }
217217
218218 // handle chunks
219219 while ( true ) {
220220 bufSize = _decCircularBuffer . Size ;
221221 // check if we have any data
222222 if ( bufSize <= 0 ) {
223- logger . Debug ( "No data in _decCircularBuffer" ) ;
223+ logger . Trace ( "No data in _decCircularBuffer" ) ;
224224 return ;
225225 }
226226
@@ -246,10 +246,10 @@ public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outl
246246 logger . Error ( $ "Invalid chunk length: { chunkLen } ") ;
247247 throw new CryptoErrorException ( ) ;
248248 }
249- logger . Debug ( "Get the real chunk len:" + chunkLen ) ;
249+ logger . Trace ( "Get the real chunk len:" + chunkLen ) ;
250250 bufSize = _decCircularBuffer . Size ;
251251 if ( bufSize < CHUNK_LEN_BYTES + tagLen /* we haven't remove them */ + chunkLen + tagLen ) {
252- logger . Debug ( "No more data to decrypt one chunk" ) ;
252+ logger . Trace ( "No more data to decrypt one chunk" ) ;
253253 return ;
254254 }
255255 IncrementNonce ( false ) ;
@@ -269,16 +269,16 @@ public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outl
269269 // output to outbuf
270270 Buffer . BlockCopy ( decChunkBytes , 0 , outbuf , outlength , ( int ) decChunkLen ) ;
271271 outlength += ( int ) decChunkLen ;
272- logger . Debug ( "aead dec outlength " + outlength ) ;
272+ logger . Trace ( "aead dec outlength " + outlength ) ;
273273 if ( outlength + 100 > TCPHandler . BufferSize )
274274 {
275- logger . Debug ( "dec outbuf almost full, giving up" ) ;
275+ logger . Trace ( "dec outbuf almost full, giving up" ) ;
276276 return ;
277277 }
278278 bufSize = _decCircularBuffer . Size ;
279279 // check if we already done all of them
280280 if ( bufSize <= 0 ) {
281- logger . Debug ( "No data in _decCircularBuffer, already all done" ) ;
281+ logger . Trace ( "No data in _decCircularBuffer, already all done" ) ;
282282 return ;
283283 }
284284 }
0 commit comments