From 975ffcf72213ccd59c8baf75ad34423c22586c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rodr=C3=ADguez=20Chatruc?= <49622509+jrchatruc@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:48:25 -0300 Subject: [PATCH] Fix felt_shr shifting to the left instead of right (#239) --- 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) }