From 6132b2ad7370ff615145b6deb275d708bc8c7579 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Mon, 14 Jun 2021 13:30:14 +0200 Subject: [PATCH] Use `mul_extension` in `scalar_mul_ext` since `mul_extension` now uses a single gate. --- src/field/extension_field/target.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/field/extension_field/target.rs b/src/field/extension_field/target.rs index 20bcd382..1691fba2 100644 --- a/src/field/extension_field/target.rs +++ b/src/field/extension_field/target.rs @@ -255,10 +255,8 @@ impl, const D: usize> CircuitBuilder { /// Returns `a * b`, where `b` is in the extension field and `a` is in the base field. pub fn scalar_mul_ext(&mut self, a: Target, mut b: ExtensionTarget) -> ExtensionTarget { - for i in 0..D { - b.0[i] = self.mul(a, b.0[i]); - } - b + let a_ext = self.convert_to_ext(a); + self.mul_extension(a_ext, b) } /// Returns `a * b`, where `b` is in the extension of the extension field, and `a` is in the