Skip to content

Commit 5a8fd3b

Browse files
committed
ETCM-167: Fix hash docs.
1 parent 51011f2 commit 5a8fd3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/scala/io/iohk/ethereum/crypto/ECDSASignature.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ object ECDSASignature {
4343
def sign(message: ByteString, prvKey: ByteString): ECDSASignature =
4444
sign(message.toArray, keyPairFromPrvKey(prvKey.toArray), None)
4545

46-
/** Sign a message, where message is a SHA-1 hash of the original data.
46+
/** Sign a message, where message is a Keccak256 hash of the original data.
4747
*
48-
* The SHA-1 hash can be obtained with `crypto.kec256`.
48+
* The regularly used hash be obtained with `crypto.kec256`.
4949
*/
5050
def sign(message: Array[Byte], keyPair: AsymmetricCipherKeyPair, chainId: Option[Byte] = None): ECDSASignature = {
5151
require(
5252
message.size == 32,
53-
s"The message should be a SHA-1 hash, expected to be 32 bytes; got ${message.size} bytes."
53+
s"The message should be a hash, expected to be 32 bytes; got ${message.size} bytes."
5454
)
5555
val signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest))
5656
signer.init(true, keyPair.getPrivate)
@@ -154,7 +154,7 @@ case class ECDSASignature(r: BigInt, s: BigInt, v: Byte) {
154154

155155
/**
156156
* returns ECC point encoded with on compression and without leading byte indicating compression
157-
* @param message message to be signed; should be a SHA-1 hash of the actual data.
157+
* @param message message to be signed; should be a hash of the actual data.
158158
* @param chainId optional value if you want new signing schema with recovery id calculated with chain id
159159
* @return
160160
*/
@@ -163,7 +163,7 @@ case class ECDSASignature(r: BigInt, s: BigInt, v: Byte) {
163163

164164
/**
165165
* returns ECC point encoded with on compression and without leading byte indicating compression
166-
* @param message message to be signed; should be a SHA-1 hash of the actual data.
166+
* @param message message to be signed; should be a hash of the actual data.
167167
* @return
168168
*/
169169
def publicKey(message: ByteString): Option[ByteString] =

0 commit comments

Comments
 (0)