X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Futils.go;h=c85dfa9d450559a7f4866ca39e5599ba3f54f584;hb=6d9056bfe4a2d69469a1e70f3bf08f89b377b06e;hp=150dd05b24d842dd90724843d6c4a22824520ca2;hpb=c07494bbd559b9d00f391e28cfd070e18afe9900;p=gogost.git diff --git a/gost3410/utils.go b/gost3410/utils.go index 150dd05..c85dfa9 100644 --- a/gost3410/utils.go +++ b/gost3410/utils.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2019 Sergey Matveev +// Copyright (C) 2015-2021 Sergey Matveev // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -32,3 +32,10 @@ func reverse(d []byte) { func pad(d []byte, size int) []byte { return append(make([]byte, size-len(d)), d...) } + +func PointSize(p *big.Int) int { + if p.BitLen() > 256 { + return 64 + } + return 32 +}