Skip to content
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

sig missing from handshake's auth spec #218

Open
ryandotsmith opened this issue Nov 15, 2022 · 3 comments
Open

sig missing from handshake's auth spec #218

ryandotsmith opened this issue Nov 15, 2022 · 3 comments

Comments

@ryandotsmith
Copy link

ryandotsmith commented Nov 15, 2022

auth = auth-size || enc-auth-body
auth-size = size of enc-auth-body, encoded as a big-endian 16-bit integer
auth-vsn = 4
auth-body = [sig, initiator-pubk, initiator-nonce, auth-vsn, ...]
enc-auth-body = ecies.encrypt(recipient-pubk, auth-body || auth-padding, auth-size)
auth-padding = arbitrary data

Looking at various implementations, it seems like sig is:

sig = secp256k1.sign(ephemeral-privkey , shared-secret ^ initiator-nonce)

and shared-secret is:

shared-secret = ecdh.agree(privkey, remote-pubk)
@ryandotsmith
Copy link
Author

ryandotsmith commented Nov 15, 2022

Also, there might need to be a definition for auth-padding and clarification on auth-size.

Is auth-size = len(auth-body || auth-padding) instead of size of enc-auth-bod

@ryandotsmith
Copy link
Author

Ah, I suppose that auth-size can be known prior to ecies encryption using: len(auth-body || auth-padding) + 113. Does that sound correct?

@kdeme
Copy link

kdeme commented Nov 16, 2022

Ah, I suppose that auth-size can be known prior to ecies encryption using: len(auth-body || auth-padding) + 113. Does that sound correct?

Yes, 113 is the fixed ecies overhead which can be used to pre-calculate the total size.

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

No branches or pull requests

2 participants