Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
0941309
Added changes to the parser for recognising bus declarations.
Feb 20, 2024
c6cec59
Combining both parser rules in only one. Now, we can also avoid the u…
Feb 21, 2024
4c212ec
Changes made to allow the declaration of buses: MyBus a; is transform…
clararod9 Feb 24, 2024
ff3a72e
Current work
miguelis Mar 12, 2024
e5456b4
Updating with only bus' stuffs
miguelis Mar 12, 2024
72864b6
Finished bus_data and added file wire_data to store all information a…
Mar 15, 2024
820c979
Added block analysis for buses.
Mar 17, 2024
ea6c6b4
Added string representing the name of the type to VariableType::Bus a…
Mar 22, 2024
1abd9ef
Included bus treatment in symbol_analysis.
Mar 23, 2024
e087306
Corrected some errors from buses_free_of_invalid_statements.
Mar 23, 2024
6579e7b
Added constants_handler to bus decorators.
Mar 24, 2024
8f2ba5e
working on execute
clararod9 Apr 9, 2024
a276e19
Updated enviroments with buses.
Apr 10, 2024
47c5572
Merge branch 'buses-current-work' of https://github.com/Sacul231/circ…
Apr 10, 2024
10347c0
working on environment and changes execute
clararod9 Apr 10, 2024
2825ab4
Merge branch 'buses-current-work' of https://github.com/Sacul231/circ…
Apr 10, 2024
2a0eed1
Merge branch 'buses-current-work' of https://github.com/Sacul231/circ…
Apr 12, 2024
de1f290
Solved errors involving unknown_known_analysis.
Apr 12, 2024
624ab86
working on execute
clararod9 Apr 16, 2024
ea0f8d7
Merge branch 'buses-current-work' of https://github.com/Sacul231/circ…
clararod9 Apr 16, 2024
499923f
working on execute
clararod9 Apr 16, 2024
6349570
Added new errors for bus typing and new test files.
Apr 20, 2024
92da913
Incomplete modifications on type analysis for typing buses.
Apr 24, 2024
a66dd0f
Corrected two of the tests.
Apr 28, 2024
b341c51
Updated tests.
Apr 28, 2024
c5851c7
Added more tests.
Apr 28, 2024
03d6ffa
New tests.
Apr 29, 2024
f9be039
Corrected bus_test_correct_2.
Apr 29, 2024
f0d32ba
code modified using anonymous components and array assignments
alrubio Apr 29, 2024
9aea112
minor change
alrubio Apr 29, 2024
457ca3b
Improving buses_free_of_invalid_statements and symbol analysis
miguelis May 3, 2024
50d0070
Custom files should not allow the use of intermediate buses. Paramete…
miguelis May 3, 2024
940917f
Type reduction analysis for buses extension
miguelis May 3, 2024
e28e61a
Merge pull request #1 from Sacul231/buses-current-work
miguelis May 3, 2024
a059e72
Known unknown analysis for buses extension
miguelis May 4, 2024
e15f7e6
Type reduction for buses extension
miguelis May 4, 2024
526d7eb
Type check for buses extension
miguelis May 5, 2024
0b43fa4
Fixing a problem with type reduction
miguelis May 7, 2024
f7bab59
Fixed problem with known-unknown analysis
miguelis May 7, 2024
a155471
cambios clara
clararod9 May 7, 2024
bcd32da
Merge pull request #2 from Sacul231/buses-current-work
clararod9 May 7, 2024
ac8f5b1
Corrected error in ast.
May 7, 2024
ca385d6
Corrected error in ast.
May 11, 2024
58eb7f3
Changed test files.
May 11, 2024
aec9d63
Corrected error in bus_test_correct_3.
May 11, 2024
e184e11
fixing a problem reducing type with bus inside bus.
miguelis May 11, 2024
9f17a43
Merge branch 'Error_testing' of https://github.com/Sacul231/circom in…
miguelis May 11, 2024
55948d4
New error file.
May 11, 2024
24a37c8
Merge branch 'Error_testing' of https://github.com/Sacul231/circom in…
May 11, 2024
cd0837f
New error file.
May 11, 2024
d51f890
Modified bus_test_error_5.
May 11, 2024
a5672c9
Modified bus_test_error_5.
May 11, 2024
862a94a
typos
miguelis May 11, 2024
b8af148
typos
miguelis May 11, 2024
453f6ef
reducing code
miguelis May 12, 2024
e935f23
improving some parts and fixing small typos
miguelis May 13, 2024
1bc79eb
Corrected error in buses_free_of_invalid_statements to prevent the de…
May 14, 2024
63da094
Added bus syntax to some files of the Circomlib.
May 14, 2024
65ae383
Corrected error in buses_free_of_invalid_statements.
May 14, 2024
f1b659b
New modified files from the Circomlib.
May 14, 2024
3dc7a85
Modified new circomlib circuit with buses. Created folders buses and …
May 15, 2024
58b4527
Added buses to new circuits of the circomlib library.
May 16, 2024
8ef16b1
finished execute_bus
clararod9 May 16, 2024
105f85f
solving conflict
clararod9 May 16, 2024
3787fc9
New circuits from the circomlib modified.
May 17, 2024
b030cfe
cambios
clararod9 May 18, 2024
914f2b1
executed template and more
miguelis May 19, 2024
a608d28
cambios clara
clararod9 May 20, 2024
76c3eeb
cambios clara
clararod9 May 20, 2024
ce15944
working on execute
clararod9 May 20, 2024
7663848
re-estructuring code tag assignments
clararod9 May 20, 2024
04db5af
re-estructuring code tag assignments
clararod9 May 20, 2024
e5684aa
component component_representation
miguelis May 20, 2024
9ae4a2d
re-estructuring code signal assignments
clararod9 May 20, 2024
9c1c943
component representation
miguelis May 20, 2024
3fa849f
solving conflicts
miguelis May 20, 2024
d5e1cc3
re-estructuring code signal assignments
clararod9 May 20, 2024
9cd07f9
small changes clara
clararod9 May 20, 2024
2116767
component representation
miguelis May 20, 2024
fb958f1
Component representation
miguelis May 20, 2024
b26c99b
perform_bus_slice -> more modular code in execute
clararod9 May 20, 2024
c4530e8
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 May 20, 2024
eaadd83
Modified some tags.
May 21, 2024
dbea62a
Improved comments explaining the circuits of the babyjub and montgome…
May 21, 2024
d7e39f1
fixing bugs and continue in execute
clararod9 May 22, 2024
b597279
init of input buses
clararod9 May 23, 2024
190d38f
adding info signal names for assignment
clararod9 May 23, 2024
654b22d
Merge pull request #3 from Sacul231/Error_testing
miguelis May 23, 2024
00269be
solving small issues
clararod9 May 23, 2024
ed902e6
improving component and bus representation access -> now works for an…
clararod9 May 23, 2024
e91e844
refractor of execute_bus() and removing unused
clararod9 May 23, 2024
dfd9e7c
Added tags specifications and a new test for buses.
May 24, 2024
0851617
continue working on assignments
clararod9 May 24, 2024
34da3d7
finishing components
clararod9 May 24, 2024
408a2c5
fix in babyedwards -> detected missing tag
clararod9 May 24, 2024
e258e21
Merge branch 'Error_testing'
May 25, 2024
2d72e6e
Corrected error in pointbits.
May 25, 2024
75fba3d
Corrected errors on eddsa file from circomlib.
May 25, 2024
2165e34
solving issue recursive buses
clararod9 May 25, 2024
353d8e0
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 May 25, 2024
7335149
fix missing check unasigned fields
clararod9 May 25, 2024
f4d62bc
minors
clararod9 May 28, 2024
f8477a3
solving todos and minors
clararod9 May 29, 2024
75fbaf8
fixing minors
clararod9 May 30, 2024
496ba63
working on buses: constraint equality with buses
clararod9 Jun 4, 2024
f3c1ea6
fixing missing check: tags in bus inputs when assigning just a single…
clararod9 Jun 4, 2024
f5a6f2c
allowing bus initializations both with <== and with <--.
miguelis Jun 4, 2024
23be5c8
allowing bus initializations both with <== and with <--.
miguelis Jun 4, 2024
ce45b71
adding more information in bus error typecheck
miguelis Jun 11, 2024
3390b8f
signals and buses order fixed, starting to work on code generation
clararod9 Jun 13, 2024
998de7c
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jun 13, 2024
5bfb78b
adding plonk ordered signals generation
clararod9 Jun 14, 2024
48543e9
mixing signals and buses in wires in code generation phase
clararod9 Jun 17, 2024
3490bd3
fixing minor in error code definitions
clararod9 Jun 17, 2024
03d2fa2
adding missing check in component preprocess -> removing bus call sub…
clararod9 Jun 17, 2024
4dd86a3
solving minor
clararod9 Jun 18, 2024
923b78f
new changes
clararod9 Jun 21, 2024
df5ce1d
Allowing only main'components input buses without tags
miguelis Jun 25, 2024
e37bc53
Removing a panic, when the number of signals passed to the anonymous …
miguelis Jun 25, 2024
eeef819
working on translate and minor in execute
clararod9 Jun 25, 2024
a7a40e6
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jun 25, 2024
4531e65
adding info input buses
clararod9 Jun 26, 2024
5da67f0
adding access in mapped
clararod9 Jun 26, 2024
cb95b8d
refractoring: storing info of the buses in a single table
clararod9 Jun 26, 2024
5e2795e
wasm_producer modified to handle buses in heterogeneus arrays of comp…
alrubio Jun 27, 2024
bbe0500
working on inputs info
clararod9 Jun 27, 2024
2e3c63d
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jun 27, 2024
fe621a8
adding info buses to wasm producer
clararod9 Jun 27, 2024
7ef8d99
printing output wasm for testing
clararod9 Jun 27, 2024
81f52e0
changes mixed arrays -> storing more info buses
clararod9 Jun 28, 2024
7e96aeb
adding info buses c producer
clararod9 Jun 28, 2024
0302685
adding buses to code generation
alrubio Jul 2, 2024
107190e
first complete version of wasm handling of buses in heterogeneous com…
alrubio Jul 4, 2024
19dee21
removing check sizes translate for testing
clararod9 Jul 4, 2024
1a37804
adding check sizes, first version, needs improvement
clararod9 Jul 4, 2024
dee8d42
refractor translate
clararod9 Jul 9, 2024
fcccb9c
adding code for debugging and fixing bugs
alrubio Jul 11, 2024
f77fd04
fixing bug
alrubio Jul 12, 2024
dd0e486
fixing stored size: store single element in arrays
clararod9 Jul 12, 2024
543600c
bug fixed
alrubio Jul 13, 2024
26ed9a7
bug fixed in wasm generation with buses and c++ first version for IR
alrubio Jul 15, 2024
da4fb10
bug fixed in wasm generation with buses
alrubio Jul 16, 2024
0983f85
bug fixed in wasm generation with buses
alrubio Jul 16, 2024
7934a50
moving heterogeneux accesses inside heterogeneus accesses outside
clararod9 Jul 16, 2024
aab9ba1
first complete version of C code generation for buses
alrubio Jul 17, 2024
85ce208
Merge branch 'master' of https://github.com/Sacul231/circom
alrubio Jul 17, 2024
e43ebff
adding error message unknown component assignment
clararod9 Jul 17, 2024
6e87af5
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 17, 2024
5951c4b
bug fixed
alrubio Jul 17, 2024
e270a6b
Merge branch 'master' of https://github.com/Sacul231/circom
alrubio Jul 17, 2024
18b511f
adding field name to FieldData
clararod9 Jul 17, 2024
dcb2415
first version sizes for c
clararod9 Jul 17, 2024
35e929c
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 17, 2024
c7f3609
adding symbol_dim info to Mapped
clararod9 Jul 18, 2024
f80898c
bug fixed in code generation with heterogeneous components
alrubio Jul 18, 2024
8d1e888
solving issue dims
clararod9 Jul 19, 2024
7ccb2a6
bug fixed in code generation with heterogeneous components
alrubio Jul 20, 2024
afdf66b
minors execute
clararod9 Jul 20, 2024
c466a2e
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 20, 2024
26ecf7e
Adding buses documentation
miguelis Jul 22, 2024
fbac9f6
Documentation on buses
miguelis Jul 22, 2024
e42ff3b
minor improvements on execute
clararod9 Jul 22, 2024
0497feb
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 22, 2024
665c398
Reading qualified inputs for JS added
alrubio Jul 23, 2024
0736557
Merge branch 'master' of https://github.com/Sacul231/circom
alrubio Jul 23, 2024
77dc9b9
qualified inputs for C++ added
alrubio Jul 23, 2024
7e45bec
solving conflicts
clararod9 Jul 23, 2024
199e6fc
Merge branch 'iden3-master' into solving_conflicts
clararod9 Jul 23, 2024
2729899
solving conflicts
clararod9 Jul 23, 2024
9fa0242
Merge of the code generation done
alrubio Jul 24, 2024
55adaed
solving conflicts build_stack
clararod9 Jul 24, 2024
c9b2df0
Update buses.md with inputs info
miguelis Jul 24, 2024
cd3690b
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 24, 2024
f378171
Merge pull request #5 from Sacul231/solving_conflicts
clararod9 Jul 24, 2024
68a8c83
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Jul 24, 2024
3aa572b
adding multiple size for inputs of heterogeneus buses
clararod9 Jul 25, 2024
ee3a614
Make some types public so that other projects can use Circom librarie…
olomix Jul 30, 2024
22de6cb
Merge branch 'master' of github.com:olomix/circom
olomix Jul 30, 2024
addc61c
add hardhat-zkit to community tools
Arvolear Aug 2, 2024
1513bec
clean up readme
Arvolear Aug 7, 2024
31a87ff
Update basic-operators.md
miguelis Aug 21, 2024
570911a
Applying modulo field prime number to every constant in the AST
miguelis Aug 22, 2024
781c779
solving conflicts
miguelis Aug 22, 2024
9a4215b
Remove unnecessary brackets and fix the formula for the bitwise left …
miguelis Aug 22, 2024
b1f795d
Refactor complement_254 function to handle sign correctly
miguelis Aug 22, 2024
c133004
Merge pull request #284 from Arvolear/master
OBrezhniev Sep 19, 2024
620c25d
extending dynamic template output array size to wasm
alrubio Sep 20, 2024
dae7e33
solving issue assignment sizes
clararod9 Sep 22, 2024
c05e941
case return solved
clararod9 Sep 23, 2024
e9f47b1
solving case multiple in src
clararod9 Sep 23, 2024
9cb396e
inpunt counter bug fixed and minor changes
alrubio Sep 23, 2024
de13dc5
Merge branch 'master' of https://github.com/Sacul231/circom
alrubio Sep 23, 2024
006d7b8
solving minor case call and error unknown accesses to components
clararod9 Sep 24, 2024
4c15e8f
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Sep 24, 2024
27bff30
minors
clararod9 Sep 24, 2024
abb690b
case main with no inputs only executing once'
clararod9 Sep 24, 2024
58b2b70
handling multiple sizes in source of stores in wasm
alrubio Sep 25, 2024
4112cc8
Merge branch 'master' of https://github.com/Sacul231/circom
alrubio Sep 25, 2024
8c7e2c7
handling multiple sizes in source of stores in wasm completed
alrubio Sep 25, 2024
a227563
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Sep 25, 2024
b3ba731
bugs fixed in wasm code generation for multiple sizes
alrubio Sep 25, 2024
55e06d6
Refactor parsing logic for signal and bus headers (input and output c…
miguelis Sep 25, 2024
f97b7ca
Complement function depends on the number of bits of the prime number
miguelis Sep 25, 2024
5c3f0c4
allowing array assignments of different sizes case variables
clararod9 Sep 25, 2024
bda88b2
Merge pull request #6 from iden3/master
clararod9 Sep 25, 2024
4044dbd
Merge pull request #295 from olomix/master
clararod9 Sep 27, 2024
838b6d2
Add Circomkit to README
erhant Sep 30, 2024
d260e06
Merge pull request #303 from erhant/patch-1
OBrezhniev Sep 30, 2024
098f883
minor
clararod9 Oct 2, 2024
3a3d868
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Oct 2, 2024
6ee4622
removing debugging messages
clararod9 Oct 2, 2024
c6f8bc7
Refactor anonymous component statement handling in parser to improve …
miguelis Oct 2, 2024
a5763a2
removing warnings
clararod9 Oct 3, 2024
7f062b5
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Oct 3, 2024
849207d
removing warning
clararod9 Oct 4, 2024
e24b139
Fixing report errors when missing parenthesis
miguelis Oct 4, 2024
2fdc254
setting default simplification option to --01
clararod9 Oct 4, 2024
16c7394
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Oct 4, 2024
77a2f6d
Merge branch 'iden3:master' into master
clararod9 Oct 4, 2024
4686814
--O1 is now the default option. Updating the documentation accordingly.
miguelis Oct 4, 2024
1f3bb12
Update RELEASES.md
miguelis Oct 4, 2024
71a368c
Update simplification.md
alrubio Oct 4, 2024
6f6bfed
Update RELEASES.md
alrubio Oct 4, 2024
503a54e
Update simplification.md
alrubio Oct 4, 2024
5facb07
updating version to 2.2.0
clararod9 Oct 4, 2024
7ee564c
Merge branch 'master' of https://github.com/Sacul231/circom
clararod9 Oct 4, 2024
4cfd011
Merge pull request #304 from Sacul231/master
clararod9 Oct 4, 2024
db8e9cf
Update mkdocs.yml
clararod9 Oct 4, 2024
6a57d80
Fixing examples in buses doc
alrubio Oct 4, 2024
f28bb57
Refactor variable tag analysis in unknown_known_analysis.rs
miguelis Oct 4, 2024
16a07c6
solving minor issue: access of bus tags
clararod9 Oct 4, 2024
89e2443
Minor
alrubio Oct 7, 2024
104d984
Merge pull request #305 from Sacul231/master
clararod9 Oct 7, 2024
e87b89f
When --O2, we must apply --O2
miguelis Oct 7, 2024
9fd40a3
Refactor help message for --O1 option in input_user.rs to clarify --O…
miguelis Oct 7, 2024
db8df24
circom 2.2.0
Arvolear Oct 8, 2024
79fb0bc
wasm build 2.2.0
Arvolear Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# Release notes
## October 07, 2024 circom 2.2.0
#### New features
- Buses: more information [here](https://github.com/iden3/circom/blob/master/mkdocs/docs/circom-language/buses.md).

#### Changes
- input/output keywords are the first token in declarations (though having it after "signal" is still accepted).
- The default option for constraint simplification is --O1 (instead of --O2 which was the default until now). More information in [here](https://github.com/iden3/circom/blob/master/mkdocs/docs/circom-language/circom-insight/simplification.md).

#### Extensions
- Allowing array assignments of different sizes.
- Improving error reports when parsing.
- Improving documentation.

#### Fixed bugs
- Main with no inputs is now executed once.
- Fixing complement function to depend on the prime number used.
- Applying modulo prime number to any constant in the circuit.
- Fixing minor panic: the number of signals passed to the anonymous component must be equal to the actual number of inputs.


## April 23, 2024 circom 2.1.9

#### Extensions
Expand Down
2 changes: 1 addition & 1 deletion circom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "circom"
version = "2.1.9"
version = "2.2.0"
authors = ["Costa Group UCM","iden3"]
edition = "2018"

Expand Down
5 changes: 2 additions & 3 deletions circom/src/input_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ mod input_processing {
else {Ok(SimplificationStyle::O2(no_rounds))}}
else { Result::Err(eprintln!("{}", Colour::Red.paint("invalid number of rounds"))) }
},

(false, false, false, true) => Ok(SimplificationStyle::O2(usize::MAX)),
(false, false, false, false) => Ok(SimplificationStyle::O2(usize::MAX)),
(false, false, false, false) => Ok(SimplificationStyle::O1),
}
}

Expand Down Expand Up @@ -413,7 +412,7 @@ mod input_processing {
.long("O1")
.hidden(false)
.takes_value(false)
.help("Only applies signal to signal and signal to constant simplification")
.help("Only applies signal to signal and signal to constant simplification. This is the default option")
.display_order(460)
)
.arg(
Expand Down
5 changes: 4 additions & 1 deletion circom/src/parser_user.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
use super::input_user::Input;
use program_structure::constants::UsefulConstants;
use program_structure::error_definition::Report;
use program_structure::program_archive::ProgramArchive;
use crate::VERSION;


pub fn parse_project(input_info: &Input) -> Result<ProgramArchive, ()> {
let initial_file = input_info.input_file().to_string();
let result_program_archive = parser::run_parser(initial_file, VERSION, input_info.get_link_libraries().to_vec(), input_info.save_ast, input_info.ast_path.clone());
//We get the prime number from the input
let prime = UsefulConstants::new(&input_info.prime()).get_p().clone();
let result_program_archive = parser::run_parser(initial_file, VERSION, input_info.get_link_libraries().to_vec(), &prime, input_info.save_ast, input_info.ast_path.clone());
match result_program_archive {
Result::Err((file_library, report_collection)) => {
Report::print_reports(&report_collection, &file_library);
Expand Down
2 changes: 1 addition & 1 deletion circom_algebra/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "circom_algebra"
version = "2.1.4"
version = "2.2.0"
authors = ["Costa Group UCM","iden3"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions circom_algebra/src/algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,13 @@ impl<C: Default + Clone + Display + Hash + Eq> ArithmeticExpression<C> {
}

// Bit operations
pub fn complement_254(
pub fn complement(
elem: &ArithmeticExpression<C>,
field: &BigInt,
) -> ArithmeticExpression<C> {
use ArithmeticExpression::*;
if let Number { value } = elem {
Number { value: modular_arithmetic::complement_254(value, field) }
Number { value: modular_arithmetic::complement(value, field) }
} else {
NonQuadratic
}
Expand Down
16 changes: 8 additions & 8 deletions circom_algebra/src/modular_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ pub fn multi_inv(values: &Vec<BigInt>, field: &BigInt) -> Vec<BigInt>{
}

//Bit operations

// 254 bit complement
pub fn complement_254(elem: &BigInt, field: &BigInt) -> BigInt {
pub fn complement(elem: &BigInt, field: &BigInt) -> BigInt {
let (sign, mut bit_repr) = bit_representation(elem);
while bit_repr.len() > 254 {
let new_sign = if elem == &BigInt::from(0) { Sign::Plus } else { sign};
let nbits = field.bits();
while bit_repr.len() > nbits {
bit_repr.pop();
}
for _i in bit_repr.len()..254 {
for _i in bit_repr.len()..nbits {
bit_repr.push(0);
}
for bit in &mut bit_repr {
*bit = if *bit == 0 { 1 } else { 0 };
}
let cp = BigInt::from_radix_le(sign, &bit_repr, 2).unwrap();
let cp = BigInt::from_radix_le(new_sign, &bit_repr, 2).unwrap();
modulus(&cp, field)
}

Expand Down Expand Up @@ -252,8 +252,8 @@ mod tests {
.expect("generating the big int was not possible");
let big_num = BigInt::parse_bytes("1234".as_bytes(), 10)
.expect("generating the big int was not possible");
let big_num_complement = complement_254(&big_num, &field);
let big_num_complement_complement = complement_254(&big_num_complement, &field);
let big_num_complement = complement(&big_num, &field);
let big_num_complement_complement = complement(&big_num_complement, &field);
let big_num_modulus = modulus(&big_num, &field);
assert_eq!(big_num_complement_complement, big_num_modulus);
}
Expand Down
2 changes: 1 addition & 1 deletion code_producers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "code_producers"
version = "2.1.9"
version = "2.2.0"
authors = ["Costa Group UCM","iden3"]
edition = "2018"

Expand Down
Loading