pub fn fadd(a: Uint256, b: Uint256) -> Uint256 {
    let add = BigUint::from_bytes_le( &a.to_bytes_le() ) + BigUint::from_bytes_le( &b.to_bytes_le() );
    let val_bytes = add.modpow( &BigUint::new(vec![1]) , &BigUint::from_bytes_le( &get_k_modulus().to_bytes_le() ) ).to_bytes_le(); // (a + b) % K_MOD
    return Uint256::from_bytes_le(&val_bytes);
}
// Using BigUint allows overflow of Uint256
Using BigUint allows overflow of Uint256
Using BigUint allows overflow of Uint256
pub fn fadd(a: Uint256, b: Uint256) -> Uint256 {
    let add = BigUint::from_bytes_le( &a.to_bytes_le() ) + BigUint::from_bytes_le( &b.to_bytes_le() );
    let val_bytes = add.modpow( &BigUint::new(vec![1]) , &BigUint::from_bytes_le( &get_k_modulus().to_bytes_le() ) ).to_bytes_le(); // (a + b) % K_MOD
    return Uint256::from_bytes_le(&val_bytes);
}
pub fn fadd ( a : Uint256 , b : Uint256 ) -> Uint256 { let add = BigUint :: from_bytes_le ( & a . to_bytes_le ( ) ) + BigUint :: from_bytes_le ( & b . to_bytes_le ( ) ) ; let val_bytes = add . modpow ( & BigUint :: new ( vec ! [ 1 ] ) , & BigUint :: from_bytes_le ( & get_k_modulus ( ) . to_bytes_le ( ) ) ) . to_bytes_le ( ) ; // (a + b) % K_MOD return Uint256 :: from_bytes_le ( & val_bytes ) ; }
Using BigUint allows overflow of Uint256
Using BigUint allows overflow of Uint256
a
Uint256
b
Uint256
a
Uint256
b
Uint256