X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Futils.go;h=c85dfa9d450559a7f4866ca39e5599ba3f54f584;hb=6d9056bfe4a2d69469a1e70f3bf08f89b377b06e;hp=2f22d3bcee751705edad8954c17c4315d2fcd7e7;hpb=c40d1e5634cf6d540d908a57423f4b504e39f186;p=gogost.git diff --git a/gost3410/utils.go b/gost3410/utils.go index 2f22d3b..c85dfa9 100644 --- a/gost3410/utils.go +++ b/gost3410/utils.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2020 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 +}