Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

reduce_modulo_order

This is used to cast a felt252 into the curve order. It is used mainly in challenge computation. We could implement more complex function to avoid non-uniform distribution in the challenge space (using hashes for example). The chance of falling in a felt252 that are not in CURVE_ORDER are low.

Note: The diference between a felt252 and CURVE_ORDER is ~ 270. So the chances of hashing anything and not to land inside CURVE_ORDER are ~ 270/2**252.

Fully qualified path: she::utils::reduce_modulo_order

pub fn reduce_modulo_order(number: felt252) -> felt252