Skip to content

internal/age: add x25519KeySize constant to replace repeated integer literals#1

Closed
mdlayher wants to merge 1 commit into
FiloSottile:masterfrom
mdlayher:mdl-xkeysize
Closed

internal/age: add x25519KeySize constant to replace repeated integer literals#1
mdlayher wants to merge 1 commit into
FiloSottile:masterfrom
mdlayher:mdl-xkeysize

Conversation

@mdlayher
Copy link
Copy Markdown
Contributor

@mdlayher mdlayher commented Oct 7, 2019

Signed-off-by: Matt Layher mdlayher@gmail.com

A quick tidy up to replace some "magic numbers" that appear in various places in the X25519 code.

…literals

Signed-off-by: Matt Layher <mdlayher@gmail.com>
@moritzdietz
Copy link
Copy Markdown

Maybe I have this wrong, but didn't he specifically leave those values to the fixed 32?

@FiloSottile
Copy link
Copy Markdown
Owner

Yeah, I went back and forth a couple times on this but I really don't like [x25519KeySize]byte.

To solve the impasse, I am just switching us to a prototype of golang/go#32670.

@FiloSottile FiloSottile closed this Oct 9, 2019
@depado
Copy link
Copy Markdown

depado commented Oct 9, 2019

Maybe I have this wrong, but didn't he specifically leave those values to the fixed 32?

This is the very definition of a magic number. See this for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants