chore: uses if_then_zero only in HPU ERC20 whitepaper (to be updated when encrypt_trivial becomes available on HPU), adds test of if_then_zero for both CPU & HPU

This commit is contained in:
pgardratzama
2026-01-06 15:23:40 +01:00
committed by Pierre Gardrat
parent 122ef489fd
commit d2a570bdd6
4 changed files with 36 additions and 2 deletions

View File

@@ -34,12 +34,12 @@ where
{
let has_enough_funds = (from_amount).ge(amount);
let amount_to_transfer = {
#[cfg(feature = "gpu")]
#[cfg(not(feature = "hpu"))]
{
let zero_amount = FheType::encrypt_trivial(0u64);
has_enough_funds.select(amount, &zero_amount)
}
#[cfg(not(feature = "gpu"))]
#[cfg(feature = "hpu")]
{
has_enough_funds.if_then_zero(amount)
}