[#190] crypto: Doc RegisterScheme isn't thread-unsafe

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-04-19 11:18:29 +03:00 committed by LeL
parent 9f20d74d76
commit 6554c681c8

View file

@ -32,6 +32,8 @@ var publicKeys = make(map[Scheme]func() PublicKey)
// function in packages that implement signature schemes.
//
// RegisterScheme panics if function for the given Scheme is already registered.
//
// Note that RegisterScheme isn't tread-safe.
func RegisterScheme(scheme Scheme, f func() PublicKey) {
_, ok := publicKeys[scheme]
if ok {