From f225ea495d083a797b12e804fa53e3718f1beec6 Mon Sep 17 00:00:00 2001 From: Dmitry Vagner Date: Mon, 24 Apr 2023 13:44:31 -0700 Subject: [PATCH] add comment --- .../asm/curve/bn254/curve_arithmetic/pairing.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/evm/src/cpu/kernel/asm/curve/bn254/curve_arithmetic/pairing.asm b/evm/src/cpu/kernel/asm/curve/bn254/curve_arithmetic/pairing.asm index d89c9c31..b6df8a94 100644 --- a/evm/src/cpu/kernel/asm/curve/bn254/curve_arithmetic/pairing.asm +++ b/evm/src/cpu/kernel/asm/curve/bn254/curve_arithmetic/pairing.asm @@ -11,6 +11,16 @@ /// result = bn254_final_exponent(out) /// return result == @GENERATOR_PAIRING +/// The following is a key to this API +/// +/// - k is the number of inputs, +/// - each input given by a pair of points, one on the curve and one on the twisted curve +/// - each input consists of 6 stack terms---2 for the curve point and 4 for the twisted curve point +/// - the inputs are presumed to be placed on the kernel contiguously +/// - the output (as defined above) is an Fp12 element +/// - out and inp are the BnPairing segment offsets for the output element and input +/// - the assembly code currently uses offsets 0-78 for scratch space + global bn254_pairing: // stack: k, inp, out, retdest DUP1