Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand committed Apr 24, 2023
1 parent e1a5ae1 commit 6888ed8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/hint_processor/builtin_hint_processor/secp/bigint_utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use core::ops::Shl;

use crate::hint_processor::builtin_hint_processor::uint_utils::{pack, split};
use crate::stdlib::{borrow::Cow, collections::HashMap, prelude::*};
use crate::{
Expand All @@ -16,7 +18,7 @@ use crate::{
vm::{errors::hint_errors::HintError, vm_core::VirtualMachine},
};
use felt::Felt252;
use num_bigint::{BigInt, BigUint, ToBigInt};
use num_bigint::{BigInt, BigUint};
use num_traits::Bounded;

// Uint384 and BigInt3 are used interchangeably with BigInt3
Expand Down Expand Up @@ -87,9 +89,12 @@ impl BigInt3<'_> {
}

pub(crate) fn pack86(self) -> BigInt {
pack([self.d0, self.d1, self.d2], 86)
.to_bigint()
.unwrap_or_default()
let limbs = [self.d0, self.d1, self.d2];
limbs
.into_iter()
.enumerate()
.map(|(idx, value)| value.to_bigint().shl(idx * 86))
.sum()
}

pub(crate) fn split(num: &BigUint) -> Self {
Expand Down

0 comments on commit 6888ed8

Please sign in to comment.