forked from TrueCloudLab/frostfs-sdk-go
[#319] crypto: Fix signing in go v1.19
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
737e690482
commit
7578b54fac
3 changed files with 15 additions and 5 deletions
|
@ -31,7 +31,16 @@ func (x Signer) Sign(data []byte) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return elliptic.Marshal(elliptic.P256(), r, s), nil
|
||||
params := elliptic.P256().Params()
|
||||
curveOrderByteSize := params.P.BitLen() / 8
|
||||
|
||||
buf := make([]byte, 1+curveOrderByteSize*2)
|
||||
buf[0] = 4
|
||||
|
||||
_ = r.FillBytes(buf[1 : 1+curveOrderByteSize])
|
||||
_ = s.FillBytes(buf[1+curveOrderByteSize:])
|
||||
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
// Public initializes PublicKey and returns it as neofscrypto.PublicKey.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue