This commit is contained in:
Dmitry Vagner 2023-03-15 19:34:33 -07:00
parent a8956b9408
commit 459d292964
2 changed files with 3 additions and 42 deletions

View File

@ -440,7 +440,7 @@ impl<'a> Interpreter<'a> {
}
#[allow(dead_code)]
fn run_addfp381_lo(&mut self) {
fn run_addfp381(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
@ -451,24 +451,11 @@ impl<'a> Interpreter<'a> {
let z = (x + y) % BLS_BASE;
self.push(U256(z.0[4..].try_into().unwrap()));
}
#[allow(dead_code)]
fn run_addfp381_hi(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
let y0 = self.pop();
let x = U512::from(x0) + (U512::from(x1) << 256);
let y = U512::from(y0) + (U512::from(y1) << 256);
let z = (x + y) % BLS_BASE;
self.push(U256(z.0[..4].try_into().unwrap()));
}
#[allow(dead_code)]
fn run_mulfp254_lo(&mut self) {
fn run_mulfp381(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
@ -479,24 +466,11 @@ impl<'a> Interpreter<'a> {
let z = (Fp381 { val: x } * Fp381 { val: y }).val;
self.push(U256(z.0[4..].try_into().unwrap()));
}
#[allow(dead_code)]
fn run_mulfp254_hi(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
let y0 = self.pop();
let x = U512::from(x0) + (U512::from(x1) << 256);
let y = U512::from(y0) + (U512::from(y1) << 256);
let z = (Fp381 { val: x } * Fp381 { val: y }).val;
self.push(U256(z.0[..4].try_into().unwrap()));
}
#[allow(dead_code)]
fn run_subfp381_lo(&mut self) {
fn run_subfp381(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
@ -507,19 +481,6 @@ impl<'a> Interpreter<'a> {
let z = (BLS_BASE + x - y) % BLS_BASE;
self.push(U256(z.0[4..].try_into().unwrap()));
}
#[allow(dead_code)]
fn run_subfp381_hi(&mut self) {
let x1 = self.pop();
let x0 = self.pop();
let y1 = self.pop();
let y0 = self.pop();
let x = U512::from(x0) + (U512::from(x1) << 256);
let y = U512::from(y0) + (U512::from(y1) << 256);
let z = (BLS_BASE + x - y) % BLS_BASE;
self.push(U256(z.0[..4].try_into().unwrap()));
}