Simplify and rename hash functions

This commit is contained in:
Jonny Stoten
2024-05-08 10:28:01 +01:00
parent d5b059043f
commit e3d02ab2e1
9 changed files with 11 additions and 15 deletions

View File

@@ -38,7 +38,7 @@ func (s *ECDSA256_SignerVerifier) Verify(ctx context.Context, data []byte, sig [
if !ok {
return fmt.Errorf("public key is not ecdsa")
}
ok = ecdsa.VerifyASN1(pub, util.S256(data), sig)
ok = ecdsa.VerifyASN1(pub, util.SHA256(data), sig)
if !ok {
return fmt.Errorf("payload signature is not valid")
}

View File

@@ -13,5 +13,5 @@ func KeyID(pubKey crypto.PublicKey) (string, error) {
if err != nil {
return "", fmt.Errorf("error marshalling public key: %w", err)
}
return util.HexHashBytes(pub), nil
return util.SHA256Hex(pub), nil
}