fix(noise): fixed trace parameter

This commit is contained in:
s1fr0 2022-04-08 20:28:01 +02:00
parent 3f20d23028
commit 61d65bc87e
No known key found for this signature in database
GPG Key ID: 2C041D60117BFF46
1 changed files with 2 additions and 2 deletions

View File

@ -372,7 +372,7 @@ proc encryptWithAd(state: var CipherState, ad, plaintext: openArray[byte]): seq[
if state.n > NonceMax:
raise newException(NoiseNonceMaxError, "Noise max nonce value reached")
trace "encryptWithAd", tag = byteutils.toHex(tag), data = ciphertext, nonce = state.n - 1
trace "encryptWithAd", authorizationTag = byteutils.toHex(authorizationTag), ciphertext = ciphertext, nonce = state.n - 1
return ciphertext
@ -575,7 +575,7 @@ proc decrypt*(
# the ciphertext (overwritten to plaintext) (data), the associated data (ad)
ChaChaPoly.decrypt(state.k, state.nonce, tagOut, plaintext, state.ad)
#TODO: add unpadding
trace "decrypt", tagIn = tagIn.shortLog, tagOut = tagOut.shortLog, nonce = state.nonce
trace "decrypt", tagIn = tagIn, tagOut = tagOut, nonce = state.nonce
# We check if the authorization tag computed while decrypting is the same as the input tag
if tagIn != tagOut:
debug "decrypt failed", plaintext = shortLog(plaintext)