wsddn / go-ecdh

Golang implementation of the elliptical curve diffie-hellman
BSD 3-Clause "New" or "Revised" License
48 stars 22 forks source link

Change Size of Keys #5

Open dfense opened 7 years ago

dfense commented 7 years ago

I have a current project that uses ECDH from this embedded library and was hoping to get your library to talk to it.

https://github.com/kmackay/micro-ecc It uses different key sizes, where it looks like yours uses 32,32 public,private

Public Key (64 bytes) Private Key (32 bytes)

I believe it's due to the way the referenced github library defaulted, but i cannot make changes to the embedded device that has it implemented using library above.

I am not familiar enough with the algorithm to know, in all the places you have a hard coded in size, how much would get corrupted by making the change and if the hash etc belongs to one of the key sizes.

Is it possible to wrap your sizes in a const () at the top, and make it easily changeable ?

wsddn commented 7 years ago

I'm not too sure how this would be implemented.

I would expect that simply changing the public key to 64 bytes will leave the last 32 bytes of the public key empty, which isn't really what you want I think.