-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep HMAC case consistent #547
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would then be consistent to also use hmac
instead of HMAC
in the description of hops_data
.
I couldn't find the exact spot, can you tell me the line? |
In the description of |
I was suggesting to use Observe that the |
Yes I'm suggesting it's consistent to use lowercase here as well (we use lowercase for field names everywhere else). |
In that case, would you consider some other way for differentiating the two kinds of HMAC, e.g. |
Yes but I don't think it's needed, though fixing naming inconsistencies may be useful. This part of the spec is fairly technical and probably harder to understand than other BOLTs but I don't think that people trying to implement it would get confused by the packet/hop data HMAC fields having the same name. In other words, for me using lowercase for the |
5065476
to
01b09a2
Compare
Ok, I just changed all fields to lowercase |
IRC discussion indicated most folks prefer upper-case for cryptographic primitives, especially when they're acronyms. |
01b09a2
to
05dd5f6
Compare
Fixed |
05dd5f6
to
b100bbe
Compare
All |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also NACK'ing this; is inconsistent with all other field names.
NACK too, I prefer consistency here. |
@niftynei @t-bast what do you suggest? Summarizing options:
|
I would not change anything (keep all hmac fields lowercase). I honestly didn't find this confusing when implementing. |
Currently not all fields are lowercase. Initially this PR was just for lowercasing the Given that a change is needed, we may as well choose something unambiguous for field names (I got confused when I first read this). My recommendation is to change the field names to |
Indeed, I didn't notice that in some struct fields it's upper-case. I don't like renaming those, I think it's more confusing: these macs always authenticate the whole onion. The outer one authenticates the onion before decryption, the inner one authenticates the new onion you obtain after decryption (the onion you will forward to the next node). Does that make sense? |
Good point, those names would be confusing. I therefore support lowercasing all fields. @TheBlueMatt maybe the objections from IRC are now obsolete? Or are there still folks that prefer |
Change `hmac` to `HMAC` fields in packet description to keep consistent with the convention of uppercase cryptographic acronym field names
b100bbe
to
e3fc992
Compare
I changed all " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, ACK e3fc992
.
Change
HMAC
to lowercase in packet description, as it later appears inlowercase. The uppercase version is used in the
hops_data
, so thischange helps avoid confusion.