i256
I256 - Signed 256-bit Integer ImplementationThis module provides a custom implementation of a signed 256-bit integer type for the Obscura privacy-preserving system. Since Cairo doesn't have native signed integers, this implementation provides the necessary functionality for handling negative amounts in deposits and withdrawals. ## Implementation DetailsThe I256 type is implemented as a struct containing: - value
: An unsigned 256-bit integer representing the absolute value - is_negative
: A boolean flag indicating the sign ## Mathematical OperationsThe implementation provides standard arithmetic operations: - Addition and subtraction with proper sign handling - Negation for sign changes - Comparison operations (less than, greater than, etc.) - Conversion to and from u256 ## Usage in ObscuraI256 is primarily used for: - Representing external amounts (positive for deposits, negative for withdrawals) - Fee calculations and public amount computations - Maintaining mathematical consistency in zero-knowledge proofs
Fully qualified path: obscura::custom_type::i256