snarkify / sirius

A Plonkish folding framework for Incrementally Verifiable Computation (IVC).
MIT License
139 stars 19 forks source link

feat(BigNatMultMod): `BitNat` -> `BigUint` #9

Closed cyphersnake closed 1 year ago

cyphersnake commented 1 year ago
          should we allow all zero limbs here?

_Originally posted by @chaosma in https://github.com/snarkify/Sirius/pull/4#discussion_r1312150576_

@chaosma will check is it needed

chaosma commented 1 year ago

@cyphersnake In set theory or computer science, natural number starts from $0$. In number theory, natural number starts from $1$. In our case, we can either use the nameBigNat or BigInt (whichever you prefer). And we allow all zero limbs.

drouyang commented 1 year ago

bigint is a typical name. biguint is a type in num_bigint.

https://docs.rs/num-bigint/latest/num_bigint/struct.BigUint.html

cyphersnake commented 1 year ago

BigInt - signed, BigUint - unsigned

int\uint is common for CS, in Rust abbreviated versions are used, but all types also correspond to this naming. I'm not sure who authored this abbreviation, but it must have been C

If we don't need numbers with a sign, BigUint is the most correct choice, since BigNat causes misunderstandings (due to differences in interpretation in math and CS), and BigInt implies a sign (like any integer type by default).

drouyang commented 1 year ago

I know the difference of int and uint.

If you look at the name of big integer libraries in other languages, I think bignum or bigint are typical.

drouyang commented 1 year ago

I think bigint or bignum refers to big integer/number arithmetic, not a specific signed or unsigned type.

drouyang commented 1 year ago

Is bignat referring to a directory here or a specific type here?

cyphersnake commented 1 year ago

As a developer, I will always expect significance from BigInt. see Int. I looked at several implementations in Rust, all of them have a division into signed and unsigned logic. In the C++ world, if I remember correctly, there is also this division

Let's stop with BigNum, since it doesn't refer to whether the number is signed or unsigned.