MCPcopy Create free account

hub / github.com/SoraSuegami/halo2-rsa / functions

Functions78 in github.com/SoraSuegami/halo2-rsa

↓ 41 callersMethodlimb
Returns indexed limb as [`Value<F>`]. # Arguments idx - the index of the limb to retrieve. # Return values Returns the specified limb as [`Value<F>`
src/big_integer/mod.rs:294
↓ 33 callersMethodmain_gate
Getter for [`MainGate`].
src/big_integer/chip.rs:1193
↓ 30 callersMethodnum_limbs
Returns the number of the limbs.
src/big_integer/mod.rs:299
↓ 25 callersMethodassign_constant
Generic function to assign a constant integer.
src/big_integer/chip.rs:1252
↓ 6 callersMethodbigint_chip
Getter for [`BigIntChip`].
src/chip.rs:224
↓ 6 callersMethodrange_chip
Getter for [`RangeChip`].
src/big_integer/chip.rs:1188
↓ 6 callersMethodsub
Given two inputs `a,b`, performs the subtraction `a - b`. # Arguments `ctx` - a region context. `a` - input of subtraction. `b` - input of subtractio
src/big_integer/chip.rs:310
↓ 5 callersMethodadd
Given two inputs `a,b`, performs the addition `a + b`. # Arguments `ctx` - a region context. `a` - input of addition. `b` - input of addition. # Ret
src/big_integer/chip.rs:245
↓ 5 callersMethodassigned_val
Returns the witness value as [`AssignedValue<F>`].
src/big_integer/mod.rs:258
↓ 5 callersMethodto_big_uint
Returns the witness value as [`Value<BigUint>`]. # Arguments width - bit length of each limb. # Return values Returns the witness value as [`Value<B
src/big_integer/mod.rs:348
↓ 4 callersMethodassert_zero
Asserts that that `a` is zero or not. # Arguments `ctx` - a region context. `a` - input of comparison. # Return values Reutrns [`Error`] if `a!=0`.
src/big_integer/chip.rs:1016
↓ 4 callersMethodextend_limbs
Increases the number of the limbs by adding the given [`AssignedValue<F>`] representing zero. # Arguments num_extend_limbs - the number of limbs to a
src/big_integer/mod.rs:375
↓ 4 callersMethodlimbs
Returns assigned limbs.
src/big_integer/mod.rs:321
↓ 4 callersMethodmul
Given two inputs `a,b`, performs the multiplication `a - b`. # Arguments `ctx` - a region context. `a` - input of multiplication. `b` - input of mult
src/big_integer/chip.rs:386
↓ 3 callersMethodassign_integer
Assigns a variable [`AssignedInteger`] whose [`RangeType`] is [`Fresh`]. # Arguments `ctx` - a region context. `integer` - a variable integer to assi
src/big_integer/chip.rs:62
↓ 3 callersMethoddiv_mod_main_gate
Given a integer `a` and a divisor `n`, performs `a/n` and `a mod n`. # Panics Panics if `n=0`.
src/big_integer/chip.rs:1323
↓ 3 callersMethodis_less_than
Returns an assigned bit representing whether `a` is less than `b` (`a<b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` - inp
src/big_integer/chip.rs:908
↓ 3 callersMethodis_less_than_or_equal
Returns an assigned bit representing whether `a` is less than or equal to `b` (`a<=b`). # Arguments `ctx` - a region context. `a` - input of comparis
src/big_integer/chip.rs:932
↓ 3 callersMethodis_zero
Returns an assigned bit representing whether `a` is zero or not. # Arguments `ctx` - a region context. `a` - input of comparison. # Return values Re
src/big_integer/chip.rs:754
↓ 3 callersMethodmain_gate
Getter for [`MainGate`].
src/chip.rs:238
↓ 3 callersMethodmul_mod
Given two inputs `a,b` and a modulus `n`, performs the modular multiplication `a * b mod n`. # Arguments `ctx` - a region context. `a` - input of mul
src/big_integer/chip.rs:542
↓ 3 callersMethodwithout_witnesses
(&self)
examples/rsa_example.rs:53
↓ 2 callersMethodis_equal_fresh
Returns an assigned bit representing whether `a` and `b` are equivalent, whose [`RangeType`] is [`Fresh`]. # Arguments `ctx` - a region context. `a`
src/big_integer/chip.rs:780
↓ 2 callersMethodnew_assigned_integer
Creates a new [`AssignedInteger`] from its limb representation. # Arguments limbs - the assigned limbs of the integer. # Return values Returns a new
src/big_integer/chip.rs:1205
↓ 2 callersMethodrange_chip
Getter for [`RangeChip`].
src/chip.rs:233
↓ 2 callersMethodsquare_mod
Given a input `a` and a modulus `n`, performs the modular square `a^2 mod n`. # Arguments `ctx` - a region context. `a` - input of square. `n` - a mo
src/big_integer/chip.rs:642
↓ 2 callersMethodsub_unchecked
Given two inputs `a,b` (`a>=b`), performs the subtraction `a - b`. # Panics Panics if `a<b`.
src/big_integer/chip.rs:1286
↓ 1 callersMethodassert_equal_fresh
Asserts that `a` and `b` are equivalent, whose [`RangeType`] is [`Fresh`]. # Arguments `ctx` - a region context. `a` - input of comparison whose type
src/big_integer/chip.rs:1034
↓ 1 callersMethodassert_equal_muled
Asserts that `a` and `b` are equivalent, whose [`RangeType`] is [`Muled`]. # Arguments `ctx` - a region context. `a` - input of comparison whose type
src/big_integer/chip.rs:1053
↓ 1 callersMethodassert_in_field
Asserts that `a` is in the order-`n` finite field. # Arguments `ctx` - a region context. `a` - input of comparison. `n` - a modulus. # Return values
src/big_integer/chip.rs:1150
↓ 1 callersMethodassign_constant_fresh
Assigns a constant [`AssignedInteger`] whose [`RangeType`] is [`Fresh`]. # Arguments `ctx` - a region context. `integer` - a constant integer to assi
src/big_integer/chip.rs:95
↓ 1 callersMethodassign_public_key
Assigns a [`AssignedRSAPublicKey`]. # Arguments `ctx` - a region context. `public_key` - a RSA public key to assign. # Return values Returns a new [
src/chip.rs:58
↓ 1 callersMethodassign_signature
Assigns a [`AssignedRSASignature`]. # Arguments `ctx` - a region context. `signature` - a RSA signature to assign. # Return values Returns a new [`A
src/chip.rs:80
↓ 1 callersMethodis_equal_muled
Returns an assigned bit representing whether `a` and `b` are equivalent, whose [`RangeType`] is [`Muled`]. # Arguments `ctx` - a region context. `a`
src/big_integer/chip.rs:822
↓ 1 callersMethodis_greater_than
Returns an assigned bit representing whether `a` is greater than `b` (`a>b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` -
src/big_integer/chip.rs:954
↓ 1 callersMethodis_greater_than_or_equal
Returns an assigned bit representing whether `a` is greater than or equal to `b` (`a>=b`). # Arguments `ctx` - a region context. `a` - input of compa
src/big_integer/chip.rs:976
↓ 1 callersMethodis_in_field
Returns an assigned bit representing whether `a` is in the order-`n` finite field. # Arguments `ctx` - a region context. `a` - input of comparison. `
src/big_integer/chip.rs:998
↓ 1 callersMethodmax_value
Assigns the maximum integer whose number of limbs is `num_limbs`. # Arguments `ctx` - a region context. `num_limbs` - the number of limbs. # Return
src/big_integer/chip.rs:138
↓ 1 callersMethodmodpow_public_key
Given a base `x`, a RSA public key (e,n), performs the modular power `x^e mod n`. # Arguments `ctx` - a region context. `x` - a base integer. `public
src/chip.rs:99
↓ 1 callersMethodpow_mod
Given a base `a`, a variable exponent `e`, and a modulus `n`, performs the modular power `a^e mod n`. # Arguments `ctx` - a region context. `a` - inp
src/big_integer/chip.rs:664
↓ 1 callersMethodpow_mod_fixed_exp
Given a base `a`, a fixed exponent `e`, and a modulus `n`, performs the modular power `a^e mod n`. # Arguments `ctx` - a region context. `a` - input
src/big_integer/chip.rs:710
↓ 1 callersMethodreplace_limb
Replaces the specified limb to the given value. # Arguments idx - index of the modified limb. limb - new limb.
src/big_integer/mod.rs:366
↓ 1 callersMethodrsa_chip
(&self, config: RSAConfig)
examples/rsa_example.rs:41
↓ 1 callersMethodsha256_chip
(&self, config: Sha256Config)
examples/rsa_example.rs:44
↓ 1 callersMethodverify_pkcs1v15_signature
Given a RSA public key, signed message bytes, and a pkcs1v15 signature, verifies the signature with SHA256 hash function. # Arguments layouter - a la
src/lib.rs:183
Methodadd_mod
Given two inputs `a,b` and a modulus `n`, performs the modular addition `a + b mod n`. # Arguments `ctx` - a region context. `a` - input of addition
src/big_integer/chip.rs:452
Methodassert_greater_than
Asserts that `a` is greater than `b` (`a>b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` - input of comparison. # Return v
src/big_integer/chip.rs:1112
Methodassert_greater_than_or_equal
Asserts that `a` is greater than or equal to `b` (`a>=b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` - input of comparison
src/big_integer/chip.rs:1131
Methodassert_less_than
Asserts that `a` is less than `b` (`a<b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` - input of comparison. # Return valu
src/big_integer/chip.rs:1074
Methodassert_less_than_or_equal
Asserts that `a` is less than or equal to `b` (`a<=b`). # Arguments `ctx` - a region context. `a` - input of comparison. `b` - input of comparison.
src/big_integer/chip.rs:1093
Methodassign_constant_muled
Assigns a constant [`AssignedInteger`] whose [`RangeType`] is [`Muled`]. # Arguments `ctx` - a region context. `integer` - a constant integer to assi
src/big_integer/chip.rs:119
Functionbench_pkcs1v15_1024_disabled
(c: &mut Criterion)
benches/bench.rs:393
Functionbench_pkcs1v15_1024_enabled
(c: &mut Criterion)
benches/bench.rs:379
Functionbig_pow_mod
(a: &BigUint, b: &BigUint, n: &BigUint)
src/big_integer/utils.rs:2
Methodbits_size
Returns the fewest bits necessary to express the [`BigUint`].
src/big_integer/chip.rs:1352
Methodcompute_mul_word_max
Returns the maximum limb size of [`Muled`] type integers.
src/big_integer/chip.rs:1368
Methodcompute_range_lens
Returns the bit length parameters necessary to configure the [`RangeChip`]. # Arguments num_limbs - the default number of limbs of [`Fresh`] integers
src/chip.rs:249
Methodcompute_range_lens
Returns the bit length parameters necessary to configure the [`RangeChip`]. # Arguments limb_width - the bit length of [`Fresh`] limbs. num_limbs - t
src/big_integer/chip.rs:1220
Methodconfigure
(meta: &mut ConstraintSystem<F>)
examples/rsa_example.rs:57
Methodfrom
[`AssignedLimb`] can be also represented as [`AssignedValue`].
src/big_integer/mod.rs:240
Functionmain
()
examples/rsa_example.rs:147
Methodnew
Creates new [`RSAConfig`] from [`BigIntConfig`]. # Arguments bigint_config - a configuration for [`BigIntChip`]. # Return values Returns new [`RSACo
src/chip.rs:32
Methodnew
Creates new [`RSAPublicKey`] from `n` and `e`. # Arguments n - an integer of `n`. e - a parameter `e`. # Return values Returns new [`RSAPublicKey`].
src/lib.rs:59
Methodnew
Creates new [`BigIntConfig`] from [`RangeConfig`] and [`MainGateConfig`]. # Arguments range_config - a configuration for [`RangeChip`]. main_gate_con
src/big_integer/chip.rs:33
Methodnew
Creates a new [`AssignedInteger`]. # Arguments limbs - a vector of [`AssignedLimb`]. # Return values Returns a new [`AssignedInteger`].
src/big_integer/mod.rs:316
Methodrefresh
Converts a [`Muled`] type integer to a [`Fresh`] type integer. # Arguments `ctx` - a region context. `a` - an assigned integer whose type is [`Assign
src/big_integer/chip.rs:168
Methodsquare
Given a inputs `a`, performs the square `a^2`. # Arguments `ctx` - a region context. `a` - input of square. # Return values Returns the square resul
src/big_integer/chip.rs:431
Methodsub_mod
Given two inputs `a,b` and a modulus `n`, performs the modular subtraction `a - b mod n`. # Arguments `ctx` - a region context. `a` - input of subtra
src/big_integer/chip.rs:495
Methodsublimb_bit_len
Returns the bit length of the sublimb necessary to check the range of the `bit_len_limb`-bits integer with [`RangeChip`].
src/big_integer/chip.rs:1357
Methodsynthesize
( &self, config: Self::Config, mut layouter: impl halo2wrong::halo2::circuit::Layouter
examples/rsa_example.rs:84
Functiontest_debug_and_clone_traits
()
src/big_integer/mod.rs:490
Functiontest_refresh_aux_random
()
src/big_integer/mod.rs:513
Functiontest_unimplemented
()
src/big_integer/chip.rs:3327
Functiontest_unimplemented1
()
src/chip.rs:592
Functiontest_unimplemented2
()
src/chip.rs:834
Methodto_muled
Converts the [`RangeType`] from [`Fresh`] to [`Muled`].
src/big_integer/mod.rs:263
Methodverify_pkcs1v15_signature
Given a RSA public key, a message hashed with SHA256, and a pkcs1v15 signature, verifies the signature with the public key and the hashed messaged. #
src/chip.rs:128
Methodwithout_witness
(num_limbs: usize, fix_e: BigUint)
src/lib.rs:63