Commit graph

10 commits

Author SHA1 Message Date
fb4909411c Move from nspcc-dev to TrueCloudLab
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 11:33:16 +03:00
d29d7f9c3e
Fix tests on go1.19 (#16)
* [#15] ecdsa: Fix signature marshaling with go1.19

Signed-off-by: Evgenii Stratonikov <stratonikov@runbox.com>

* [#15] go.mod: Update go version to 1.16

Signed-off-by: Evgenii Stratonikov <stratonikov@runbox.com>

* [#15] go.mod: Drop `pkg/errors` dependency

Signed-off-by: Evgenii Stratonikov <stratonikov@runbox.com>

* [#15] *: Perform `goimports -w`

Signed-off-by: Evgenii Stratonikov <stratonikov@runbox.com>

Signed-off-by: Evgenii Stratonikov <stratonikov@runbox.com>
Co-authored-by: Evgenii Stratonikov <stratonikov@runbox.com>
2022-08-15 14:49:39 +03:00
Evgenii Stratonikov
225b24f7f4 Allow to use hash in Sign*/Verify*
Sometimes having a whole buffer in memory isn't desired.
New interface allows us to provide hashes instead.
2021-03-23 13:11:42 +03:00
alexvanin
1461d7a248 rfc6979: Add leading zeros if r or s has less than 32 bytes
SignECDSA function returns two coordinates on elliptic curve.
Catenation of these coordinates is a 64 byte signature. If
one of these coordinates have less than 32 significant bytes, then
it should have leading zeros.
2020-03-01 16:50:38 +03:00
Evgeniy Kulikov
4a69978816
Update RFC6979 to new release 2020-01-16 10:10:33 +03:00
Evgeniy Kulikov
5bcaeeca4e
Merge pull request #7 from nspcc-dev/NEOFS_CRYPTO-4_Use_sha512_instead_of_sha256
Use SHA512 instead of SHA256
2019-11-12 16:42:33 +03:00
Evgeniy Kulikov
943bb90aec
Use SHA512 instead of SHA256
Fix issue #4
2019-11-12 16:00:27 +03:00
Evgeniy Kulikov
fc6fd40f5e
Change func Verify signature
- Before `func Verify*(pub *ecdsa.PublicKey, sig, msg []byte) error`
- After `func Verify*(pub *ecdsa.PublicKey, msg, sig []byte) error`
- Update tests and replace `hash` with `sign` for signatures

Fix issue #5
2019-11-12 15:52:13 +03:00
alexvanin
8fa65a0afc Use consistent parameter names for Sign and Verify functions
It may be misleading when verify function takes signature as a hash
parameter. This commit suggested to use rfc6979 original naming
for the parameters:
- `msg` as the message to sign,
- `sig` as the signature of message.
All hashing operations are encapsulated inside of the Sign
and Verify functions.

Also there are comment fixes and re-usage of `hashBytes()` in rfc6979.
2019-11-12 14:52:23 +03:00
Evgeniy Kulikov
c21ef9ef81
initial 2019-10-22 17:40:05 +03:00