@@ -129,7 +129,8 @@ int wally_asset_rangeproof(uint64_t value,
129129 const unsigned char * commitment , size_t commitment_len ,
130130 const unsigned char * extra , size_t extra_len ,
131131 const unsigned char * generator , size_t generator_len ,
132- uint64_t min_value , unsigned char * bytes_out , size_t len ,
132+ uint64_t min_value , int exp , int min_bits ,
133+ unsigned char * bytes_out , size_t len ,
133134 size_t * written )
134135{
135136 const secp256k1_context * ctx = secp_ctx ();
@@ -157,6 +158,8 @@ int wally_asset_rangeproof(uint64_t value,
157158 /* FIXME: Is there an upper size limit on the extra commitment? */
158159 (extra_len && !extra ) ||
159160 min_value > 0x7ffffffffffffffful ||
161+ exp < -1 || exp > 18 ||
162+ min_bits < 0 || min_bits > 64 ||
160163 get_generator (ctx , generator , generator_len , & gen ) != WALLY_OK )
161164 goto cleanup ;
162165
@@ -175,10 +178,8 @@ int wally_asset_rangeproof(uint64_t value,
175178 memcpy (message + ASSET_TAG_LEN , abf , ASSET_TAG_LEN );
176179
177180 * written = ASSET_RANGEPROOF_MAX_LEN ;
178- /* FIXME: This only allows 32 bit values. The caller should be able to
179- * pass in the maximum value allowed */
180181 if (secp256k1_rangeproof_sign (ctx , bytes_out , written , min_value , & commit ,
181- vbf , nonce_sha .u .u8 , 0 , 32 , value ,
182+ vbf , nonce_sha .u .u8 , exp , min_bits , value ,
182183 message , sizeof (message ),
183184 extra , extra_len ,
184185 & gen ))
0 commit comments