File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -412,11 +412,7 @@ library Math {
412412 * - modulus can't be zero
413413 * - result should be obtained succesfully
414414 */
415- function modExp (
416- uint256 b ,
417- uint256 e ,
418- uint256 m
419- ) internal view returns (uint256 ) {
415+ function modExp (uint256 b , uint256 e , uint256 m ) internal view returns (uint256 ) {
420416 require (m != 0 , "ModularExponentiation: Can't calculate for modulus equal to zero " );
421417 bool success;
422418 bytes memory result;
Original file line number Diff line number Diff line change @@ -186,14 +186,13 @@ contract MathTest is Test {
186186 // However, we can repeatedly multiply and reduce modulo m
187187
188188 uint256 expected = 1 ;
189- for (uint i = 0 ; i < e; i++ ) {
189+ for (uint i = 0 ; i < e; i++ ) {
190190 expected = _mulmod (expected, b, m);
191191 }
192192
193193 assertEq (result, expected);
194194 }
195195
196-
197196 // External call
198197 function muldiv (uint256 x , uint256 y , uint256 d ) external pure returns (uint256 ) {
199198 return Math.mulDiv (x, y, d);
@@ -211,8 +210,6 @@ contract MathTest is Test {
211210 }
212211 }
213212
214-
215-
216213 function _mulHighLow (uint256 x , uint256 y ) private pure returns (uint256 high , uint256 low ) {
217214 (uint256 x0 , uint256 x1 ) = (x & type (uint128 ).max, x >> 128 );
218215 (uint256 y0 , uint256 y1 ) = (y & type (uint128 ).max, y >> 128 );
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ contract('Math', function () {
243243 const modulus = new BN ( '0' ) ;
244244 await expectRevert (
245245 this . math . modExp . call ( base , exponent , modulus ) ,
246- ' ModularExponentiation: Can\ 't calculate for modulus equal to zero' ,
246+ " ModularExponentiation: Can't calculate for modulus equal to zero" ,
247247 ) ;
248248 } ) ;
249249 } ) ;
You can’t perform that action at this time.
0 commit comments