@@ -43,14 +43,14 @@ object ECDSASignature {
43
43
def sign (message : ByteString , prvKey : ByteString ): ECDSASignature =
44
44
sign(message.toArray, keyPairFromPrvKey(prvKey.toArray), None )
45
45
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.
47
47
*
48
- * The SHA-1 hash can be obtained with `crypto.kec256`.
48
+ * The regularly used hash be obtained with `crypto.kec256`.
49
49
*/
50
50
def sign (message : Array [Byte ], keyPair : AsymmetricCipherKeyPair , chainId : Option [Byte ] = None ): ECDSASignature = {
51
51
require(
52
52
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. "
54
54
)
55
55
val signer = new ECDSASigner (new HMacDSAKCalculator (new SHA256Digest ))
56
56
signer.init(true , keyPair.getPrivate)
@@ -154,7 +154,7 @@ case class ECDSASignature(r: BigInt, s: BigInt, v: Byte) {
154
154
155
155
/**
156
156
* 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.
158
158
* @param chainId optional value if you want new signing schema with recovery id calculated with chain id
159
159
* @return
160
160
*/
@@ -163,7 +163,7 @@ case class ECDSASignature(r: BigInt, s: BigInt, v: Byte) {
163
163
164
164
/**
165
165
* 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.
167
167
* @return
168
168
*/
169
169
def publicKey (message : ByteString ): Option [ByteString ] =
0 commit comments