From 3e23b7020916d775bf6add3d8be44d43b69d14e2 Mon Sep 17 00:00:00 2001 From: Javier Chatruc Date: Mon, 18 Sep 2023 16:39:12 -0300 Subject: [PATCH] Fix felt_shr shifting to the left instead of right --- pkg/lambdaworks/lib/lambdaworks/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lambdaworks/lib/lambdaworks/src/lib.rs b/pkg/lambdaworks/lib/lambdaworks/src/lib.rs index 97c98c6e..b772d13d 100644 --- a/pkg/lambdaworks/lib/lambdaworks/src/lib.rs +++ b/pkg/lambdaworks/lib/lambdaworks/src/lib.rs @@ -257,7 +257,7 @@ pub unsafe extern "C" fn free_string(ptr: *mut c_char) { pub extern "C" fn felt_shr(a: Limbs, b: usize, result: Limbs) { let felt_a = limbs_to_felt(a).representative(); - let res = felt_a << b; + let res = felt_a >> b; felt_to_limbs(Felt::from(&res), result) }