From caad9d9bc615c79184424b5fab7eb7f91bff31fa Mon Sep 17 00:00:00 2001 From: Nam Ngo Date: Tue, 27 Feb 2024 19:59:29 +0700 Subject: [PATCH] Update fc.circom --- src/assets/fc.circom | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/assets/fc.circom b/src/assets/fc.circom index 8c75ef5..35e5d31 100644 --- a/src/assets/fc.circom +++ b/src/assets/fc.circom @@ -1,5 +1,20 @@ pragma circom 2.0.0; +template Switcher() { + signal input sel; + signal input L; + signal input R; + signal output outL; + signal output outR; + + signal aux; + + aux <== (R-L)*sel; // We create aux in order to have only one multiplication + outL <== aux + L; + outR <== -aux + R; +} + + template fc (width, height) { signal input in[width]; signal input weights[height][width];