@@ -81,8 +81,8 @@ int ecc_recover_key(const unsigned char *sig, unsigned long siglen,
8181 err = CRYPT_INVALID_PACKET ;
8282 goto error ;
8383 }
84- if ((err = mp_read_unsigned_bin (r , ( unsigned char * ) sig , i )) != CRYPT_OK ) { goto error ; }
85- if ((err = mp_read_unsigned_bin (s , ( unsigned char * ) sig + i , i )) != CRYPT_OK ) { goto error ; }
84+ if ((err = mp_read_unsigned_bin (r , sig , i )) != CRYPT_OK ) { goto error ; }
85+ if ((err = mp_read_unsigned_bin (s , sig + i , i )) != CRYPT_OK ) { goto error ; }
8686 }
8787 else if (sigformat == LTC_ECCSIG_ETH27 ) {
8888 /* Ethereum (v,r,s) format */
@@ -102,8 +102,8 @@ int ecc_recover_key(const unsigned char *sig, unsigned long siglen,
102102 goto error ;
103103 }
104104 recid = i ;
105- if ((err = mp_read_unsigned_bin (r , ( unsigned char * ) sig , 32 )) != CRYPT_OK ) { goto error ; }
106- if ((err = mp_read_unsigned_bin (s , ( unsigned char * ) sig + 32 , 32 )) != CRYPT_OK ) { goto error ; }
105+ if ((err = mp_read_unsigned_bin (r , sig , 32 )) != CRYPT_OK ) { goto error ; }
106+ if ((err = mp_read_unsigned_bin (s , sig + 32 , 32 )) != CRYPT_OK ) { goto error ; }
107107 }
108108#ifdef LTC_SSH
109109 else if (sigformat == LTC_ECCSIG_RFC5656 ) {
@@ -150,10 +150,10 @@ int ecc_recover_key(const unsigned char *sig, unsigned long siglen,
150150 pbits = mp_count_bits (p );
151151 pbytes = (pbits + 7 ) >> 3 ;
152152 if (pbits > hashlen * 8 ) {
153- if ((err = mp_read_unsigned_bin (e , ( unsigned char * ) hash , hashlen )) != CRYPT_OK ) { goto error ; }
153+ if ((err = mp_read_unsigned_bin (e , hash , hashlen )) != CRYPT_OK ) { goto error ; }
154154 }
155155 else if (pbits % 8 == 0 ) {
156- if ((err = mp_read_unsigned_bin (e , ( unsigned char * ) hash , pbytes )) != CRYPT_OK ) { goto error ; }
156+ if ((err = mp_read_unsigned_bin (e , hash , pbytes )) != CRYPT_OK ) { goto error ; }
157157 }
158158 else {
159159 shift_right = 8 - pbits % 8 ;
@@ -162,7 +162,7 @@ int ecc_recover_key(const unsigned char *sig, unsigned long siglen,
162162 ch = (hash [i ] << (8 - shift_right ));
163163 buf [i ] = buf [i ] ^ (hash [i ] >> shift_right );
164164 }
165- if ((err = mp_read_unsigned_bin (e , ( unsigned char * ) buf , pbytes )) != CRYPT_OK ) { goto error ; }
165+ if ((err = mp_read_unsigned_bin (e , buf , pbytes )) != CRYPT_OK ) { goto error ; }
166166 }
167167
168168 /* decompress point from r=(x mod p) - BEWARE: requires sqrtmod_prime */
0 commit comments