You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on a project of which the aim is to update some smart contracts to prevent clouds from colluding to save computational power in a replication-based approach. The project uses the ECCMath_noconflict.sol and Secp256k1_noconflict.sol contracts to provide cryptography to make sure all transactions are secure and private. I have managed to update the ECCMath_noconflict.sol file so that the code alligns with the updates in Solidity 0.5.0, however, I am having issues updating Secp256k1_noconflict.sol. I have two main issues; the first being the use of empty return statements which is now disallowed in more recent versions of solidity: function _mul(uint d, uint[2] memory P) internal view returns (uint[3] memory Q) { uint p = pp; if (d == 0) {} // TODO return; uint dwPtr; // points to array of NAF coefficients. uint i;
this function returns if d == 0, however, this is now disallowed and I'm not sure how to reformat.
The second issue is the use of loops and labels in the following inline assembly code:
loop: jumpi(loop_end, iszero(d)) jumpi(even, iszero(and(d, 1))) dm := mod(d, 32) mstore8(add(dwPtr, i), dm) // Don"t store as signed - convert when reading. d := add(sub(d, dm), mul(gt(dm, 16), 32)) even: d := div(d, 2) i := add(i, 1) jump(loop) loop_end:
labels are now disallowed in the more recent solidity versions and I'm struggling to get around this. I rewrote the code like this:
`for { } gt(d, 0) {
if iszero(and(d,1)) {
d:= div(d,2)
i:= add(i,1)
}
mstore8(add(dwPtr, i), dm) // Don"t store as signed - convert when reading.
d := add(sub(d, dm), mul(gt(dm, 16), 32))`
but it was just met with errors.
Would anyone be able to point me in the right direction for updating this code so that it complies with the Solidity 0.5.0 updates?
The text was updated successfully, but these errors were encountered:
Hello,
I'm currently working on a project of which the aim is to update some smart contracts to prevent clouds from colluding to save computational power in a replication-based approach. The project uses the ECCMath_noconflict.sol and Secp256k1_noconflict.sol contracts to provide cryptography to make sure all transactions are secure and private. I have managed to update the ECCMath_noconflict.sol file so that the code alligns with the updates in Solidity 0.5.0, however, I am having issues updating Secp256k1_noconflict.sol. I have two main issues; the first being the use of empty return statements which is now disallowed in more recent versions of solidity:
function _mul(uint d, uint[2] memory P) internal view returns (uint[3] memory Q) { uint p = pp; if (d == 0) {} // TODO return; uint dwPtr; // points to array of NAF coefficients. uint i;
this function returns if d == 0, however, this is now disallowed and I'm not sure how to reformat.
The second issue is the use of loops and labels in the following inline assembly code:
loop: jumpi(loop_end, iszero(d)) jumpi(even, iszero(and(d, 1))) dm := mod(d, 32) mstore8(add(dwPtr, i), dm) // Don"t store as signed - convert when reading. d := add(sub(d, dm), mul(gt(dm, 16), 32)) even: d := div(d, 2) i := add(i, 1) jump(loop) loop_end:
labels are now disallowed in the more recent solidity versions and I'm struggling to get around this. I rewrote the code like this:
`for { } gt(d, 0) {
but it was just met with errors.
Would anyone be able to point me in the right direction for updating this code so that it complies with the Solidity 0.5.0 updates?
The text was updated successfully, but these errors were encountered: