From 0ffa520171c9707fe04983bbed3fedfc7cdb2530 Mon Sep 17 00:00:00 2001 From: PayneJoe Date: Wed, 10 Jul 2024 00:38:28 +0800 Subject: [PATCH] small code optimization --- crates/prover/src/core/circle.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/prover/src/core/circle.rs b/crates/prover/src/core/circle.rs index 5c30e55b9..a4116d369 100644 --- a/crates/prover/src/core/circle.rs +++ b/crates/prover/src/core/circle.rs @@ -151,11 +151,12 @@ impl CirclePoint { pub fn get_random_point(channel: &mut C) -> Self { let t = channel.draw_felt(); + let t_square = t.square(); - let one_plus_tsquared_inv = t.square().add(SecureField::one()).inverse(); + let one_plus_tsquared_inv = t_square.add(SecureField::one()).inverse(); let x = SecureField::one() - .add(t.square().neg()) + .add(t_square.neg()) .mul(one_plus_tsquared_inv); let y = t.double().mul(one_plus_tsquared_inv);