golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.89k stars 17.52k forks source link

proposal: x/crypto: include shamir secret sharing algorithm #47033

Closed bradbl closed 2 years ago

bradbl commented 3 years ago

I propose the inclusion of the Shamir's Secret Sharing algorithm into the x/crypto tree under a new package titled shamir.

This is a common solution to the problem of splitting a secret securely for distribution to multiple parties.

If this meets the criteria for inclusion, I would be happy to submit a patch. Thanks!

rsc commented 2 years ago

Is there any kind of standard message format or encoding for the secret parts? Any RFC or other document?

I understand the algorithm; I am trying to understand whether this would need to or be able to interoperate with any other system. If there are no systems to interoperate with, that raises a question of why, and whether we need to add it to Go.

/cc @FiloSottile

bradbl commented 2 years ago

That's a good question. I'm not aware of an RFC for this algorithm or any other authoritative standards document. It's primarily described by academic literature. Perhaps this isn't a good fit for x/crypto in that case.

rsc commented 2 years ago

Usually the reason to put something in the standard library (or x/crypto) is to interoperate with other code that would be using the same exact algorithms/protocols/etc. This doesn't seem to fit in that bucket. It would probably be best to start with a package outside the standard library. See https://golang.org/doc/faq#x_in_std for more.

bradbl commented 2 years ago

Ok, thanks @rsc for the clarification. Closing.

rsc commented 2 years ago

This proposal has been added to the active column of the proposals project and will now be reviewed at the weekly proposal review meetings. — rsc for the proposal review group

rsc commented 2 years ago

This proposal has been declined as retracted. — rsc for the proposal review group