Skip to content

Latest commit

 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIELD TRACKER

An easy tool to enable measuring the number of operations in your protocol

SET UP

  • Add field tracker to cargo.toml
[dev-dependencies]
field-tracker = { git = "https://github.com/sublinearlabs/field-tracker", branch = "main" }
  • Initialize the field tracker type
use field_tracker::{Ft, start_tscope, end_tscope, print_summary, summary};

type Fq = Ft!(ark_bn245::Fq);
  • Call the summary macro to return a summary
let summary = summary!();
  • Call the print_summary macro to print a summary to the terminal
print_summary!();
  • The start_tscope macro can be used to get more context by namespacing the operations done from where it is called until an end_tscope macro is seen. It takes a name for the namespace as an input.
start_tscope!("Sumcheck");
  • The end_tscope macro is used to end a namespace summary. It should only be called if a start_tscope was called.
end_tscope!();

Example

use field_tracker::{Ft, start_tscope, end_tscope, print_summary, summary};

type Fq = Ft!(ark_bn245::Fq);

let mut a = Fq::from(3)
let mut b = Fq::from(5);
let mut c = a + b;

start_tscope!("Layer 2");

a += c;
b += c;
d = a * b;

end_tscope!();

d -= c;

print_summary!();

About

A Rust instrumentation library for counting and profiling finite-field operations in cryptographic protocols, with scoped measurements and summary reports.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages