- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3
 
Small Fields #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
  
     Closed
                    Small Fields #78
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            53 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      ec8f61e
              
                benches and tests set up
              
              
                z-tech 68b3299
              
                linter
              
              
                z-tech fcf7efe
              
                fix non neon impl
              
              
                z-tech 3b0fcda
              
                fix non neon impl 2
              
              
                z-tech 51d3e4c
              
                add trait implementations
              
              
                benbencik 42a7ac6
              
                add fp config from algebra
              
              
                benbencik fdd3d98
              
                add hot-fixes to make FpConfig appropriate for older ark_ff
              
              
                benbencik 0d6676d
              
                the most basic macro...but works
              
              
                benbencik b0dcb5c
              
                copy FpConfig and add hot fixes
              
              
                benbencik 1212a48
              
                add garbage that compiles
              
              
                benbencik 5561e7c
              
                add From implementaitons
              
              
                benbencik b841569
              
                fix display trait
              
              
                benbencik c3eaa65
              
                fix bigint 2
              
              
                benbencik 29af509
              
                add new
              
              
                benbencik a6215e1
              
                make bigint limbs constant
              
              
                benbencik 884467b
              
                correct indexing of bigint
              
              
                benbencik 906aa00
              
                fix some todos
              
              
                benbencik 00f76ce
              
                add naive implementation for inverse
              
              
                benbencik 1b9a77d
              
                add tests
              
              
                benbencik f40a159
              
                run checks on any PR
              
              
                z-tech f330ac3
              
                bump to arkworks 0.5
              
              
                z-tech 30f3a97
              
                merge main
              
              
                z-tech 60c3b1c
              
                add constant for fixed bigint limbs
              
              
                benbencik 32af43b
              
                split small fp backend into modules
              
              
                benbencik c5e4999
              
                add benches for small fields
              
              
                benbencik e476cb6
              
                add dummy separate backend for field arithermtic
              
              
                benbencik 06fce99
              
                BigInteger expects least-significant limb first.
              
              
                benbencik b3f8000
              
                extends tests with small field
              
              
                benbencik 02cb1e8
              
                add tests
              
              
                benbencik 57171ec
              
                add overflow handling
              
              
                benbencik 84a91df
              
                merge main
              
              
                z-tech 048e9c4
              
                add garbage mont backend
              
              
                benbencik eef2324
              
                fix later
              
              
                benbencik 7607868
              
                move contructor to backend implementation
              
              
                benbencik 5b7449f
              
                add montgomery prototype
              
              
                benbencik 70d3e33
              
                select R based on modulus
              
              
                benbencik e2e820e
              
                fix errors in multiplication for standard backend
              
              
                benbencik d790d99
              
                add computation of two adicity for standard backend
              
              
                benbencik 85fb1bb
              
                add two adicity computation to mont backend
              
              
                benbencik 3c63985
              
                cleanup
              
              
                benbencik 4e16d72
              
                add benches
              
              
                benbencik ef1c24b
              
                add implementation for random sampling
              
              
                benbencik e2b3566
              
                do not use modulus_128
              
              
                benbencik 6116c05
              
                fix failing test
              
              
                benbencik 5c9cb75
              
                rewrite add_assign
              
              
                benbencik caa547d
              
                simplify from conversion
              
              
                benbencik f715dac
              
                exiting mont domain
              
              
                benbencik ab33b8e
              
                add tests for mont field
              
              
                benbencik b3ca510
              
                refactor to get rid of safe_mul function in the trait
              
              
                benbencik 1f87172
              
                simplify neg in place
              
              
                benbencik be37213
              
                polish the trait definition
              
              
                benbencik 6ac0790
              
                refactor bigint casts
              
              
                benbencik 8dfcef2
              
                fix formating
              
              
                benbencik File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| use ark_ff::Field; | ||
| use criterion::{criterion_group, criterion_main, Criterion}; | ||
| use space_efficient_sumcheck::tests::{SmallF32, SmallF32Mont}; | ||
| use std::hint::black_box; | ||
| 
     | 
||
| fn bench_mul_standard(c: &mut Criterion) { | ||
| c.bench_function("SmallField_mul", |b| { | ||
| b.iter(|| { | ||
| let mut v = SmallF32::ONE; | ||
| let v2 = SmallF32::new(20); | ||
| for _ in 0..1_000_000 { | ||
| v *= v2; | ||
| } | ||
| black_box(v); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| fn bench_mul_montgomery(c: &mut Criterion) { | ||
| c.bench_function("SmallFieldMont_mul", |b| { | ||
| b.iter(|| { | ||
| let mut v = SmallF32Mont::ONE; | ||
| let v2 = SmallF32Mont::new(20); | ||
| for _ in 0..1_000_000 { | ||
| v *= v2; | ||
| } | ||
| black_box(v); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| criterion_group!(benches, bench_mul_standard, bench_mul_montgomery); | ||
| criterion_main!(benches); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| use criterion::{criterion_group, criterion_main, Criterion}; | ||
| use std::hint::black_box; | ||
| 
     | 
||
| fn mult_u128(c: &mut Criterion) { | ||
| c.bench_function("u128_mult", |b| { | ||
| b.iter(|| { | ||
| let a: u8 = 5; | ||
| let b: u8 = 254; | ||
| let c: u128 = (a as u128) * (b as u128); | ||
| black_box((c % 255) as u8); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| fn mult_u16(c: &mut Criterion) { | ||
| c.bench_function("u16_mult", |b| { | ||
| b.iter(|| { | ||
| let a: u8 = 5; | ||
| let b: u8 = 254; | ||
| let c: u16 = (a as u16) * (b as u16); | ||
| black_box((c % 255) as u8); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| fn add_u128(c: &mut Criterion) { | ||
| c.bench_function("u128_add", |b| { | ||
| b.iter(|| { | ||
| let a: u8 = 5; | ||
| let b: u8 = 254; | ||
| let c: u128 = (a as u128) + (b as u128); | ||
| black_box((c % 255) as u8); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| fn add_u16(c: &mut Criterion) { | ||
| c.bench_function("u8_add", |b| { | ||
| b.iter(|| { | ||
| let a: u8 = 5; | ||
| let b: u8 = 25; | ||
| let c: u8 = a + b; | ||
| black_box((c % 255) as u8); | ||
| }) | ||
| }); | ||
| } | ||
| 
     | 
||
| criterion_group!(benches, mult_u128, mult_u16, add_u128, add_u16); | ||
| criterion_main!(benches); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| fn main() { | ||
| eprintln!("Error: This project uses a custom benchmarking workflow."); | ||
| eprintln!("Please navigate to the appropriate bench directory and call the shell './run_bench.sh' directly."); | ||
| eprintln!("Please choose a bench:"); | ||
| eprintln!(" Full Protocol Benches: 'cd ./benches/sumcheck-benches/ && cargo build --release && ./run_benches.sh'"); | ||
| eprintln!(" Lagrange Polynomial Benches: 'cd ./benches/lag-poly-benches/ && cargo build --release && ./run_benches.sh'"); | ||
| std::process::exit(1); | ||
| } | 
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.