D-5.8 Exact Fast Base Conversion: FastBConvEx

FastBConv (Β§D-5.1) converts an input value x’s base moduli from q β†’b, but generates a noise equivalent to π‘’π‘ž mod b where integer |u|≀k 2 + 1. If we use FastBConv with SmallMont (Β§D-5.7), we can reduce the generated noise from π‘’π‘ž to uβ€²q where uβ€² ∈{βˆ’1,0,1}. In this subsection, we introduce FastBConvEx, an algorithm for an exact fast base conversion that can eliminate the entire noise. However, using FastBConvEx has a restriction that the input value x should be relatively much smaller than its modulus. This is different from the case of using FastBConv with SmallMont which has no restriction on the input x (i.e., x can be any value within its modulus range). FastBConvEx is designed as follows:

⟨Summary D-5.8⟩ Fast Exact Base Conversion: FastBConvEx

Input: x = (x1,x2,β‹―,xl,xΞ±) ∈ β„€b1 Γ— β„€b2 Γ—β‹― Γ— β„€bl Γ— β„€bΞ±

Requirement: The size of bΞ± should be bΞ± β‰₯2 β‹…(l + Ξ»), where |x|b = x + ΞΌ β‹…b, and ΞΌ ∈[βˆ’Ξ»,Ξ»] (i.e., Ξ» and βˆ’Ξ» are the maximum and minimum possible values of ΞΌ).

# The constraint that bΞ± > ΞΌ implies that the input x should be much smaller than its modulus bbΞ± (i.e., |x|β‰ͺbbΞ± 2 )

Main Steps

1.
x^ = |x|b = π–¬π—ˆπ–½π–£π—‹π—ˆπ—‰(x,bbΞ±,b)
2.
xΞ± = |x|bΞ± = π–¬π—ˆπ–½π–£π—‹π—ˆπ—‰(x,bbΞ±,bΞ±)
3.
Ξ³ = |(π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,bΞ±) βˆ’xΞ±) β‹…bβˆ’1|bΞ±
4.
π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—π–€π—‘(x,bbΞ±,q) = |π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,q) βˆ’Ξ³ β‹…b|q = |x|q

We will prove why |π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,q) βˆ’Ξ³ β‹…b|q = |x|q.

Proof.

1.
π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,bΞ±)

= |x^ + 𝑒𝑏|bΞ± # where integer |u|≀l 2 + 1

= ||x|b + 𝑒𝑏|bΞ± # since |x|b = x^ by definition

= |x + πœ‡π‘ + 𝑒𝑏|bΞ± # since |x|b = x + πœ‡π‘ by definition

2.
Ξ³ = |(π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,bΞ±) βˆ’xΞ±) β‹…bβˆ’1|bΞ±

= |(π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,bΞ±) βˆ’xΞ± βˆ’πœ‡π‘) β‹…bβˆ’1 + ΞΌ|bΞ± # by adding |(βˆ’πœ‡π‘ + πœ‡π‘) β‹…bβˆ’1|bΞ±

= |(x + πœ‡π‘ + 𝑒𝑏 βˆ’xΞ± βˆ’πœ‡π‘) β‹…bβˆ’1 + ΞΌ|bΞ± # step 1 proved π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,bΞ±) = |x + πœ‡π‘ + u β‹…b|bΞ±

= |u + ΞΌ|bΞ±

= u + ΞΌ # because βˆ’bΞ± 2 ≀u + ΞΌ ≀bΞ± 2 βˆ’1 (since u + ΞΌ < l + Ξ» ≀bΞ± 2 , and βˆ’bΞ± 2 β‰€βˆ’(l + Ξ») < u + ΞΌ)

3.
π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—π–€π—‘(x,b,q) = |π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,q) βˆ’Ξ³ β‹…b)|q

= |x^ + 𝑒𝑏 βˆ’Ξ³ β‹…b)|q # applying π–₯π–Ίπ—Œπ—π–‘π–’π—ˆπ—‡π—(x^,b,q) = x^ + 𝑒𝑏

= |(x + πœ‡π‘) + 𝑒𝑏 βˆ’Ξ³ β‹…b)|q # applying x^ = |x|b = x + πœ‡π‘

= |(x + πœ‡π‘) + 𝑒𝑏 βˆ’(u + ΞΌ) β‹…b)|q # applying Ξ³ = u + ΞΌ from proof step 2

= |x + πœ‡π‘ + 𝑒𝑏 βˆ’π‘’π‘ βˆ’πœ‡π‘|q

= |x|q

β–‘

Necessity of the Centered (i.e., Signed) Residue Representation: In the proof step 2, we treated |u + ΞΌ|bΞ± = u + ΞΌ. To remove the modulo reduction operation, the canonical (i.e., unsigned) residue representation is inappropriate, because if u + ΞΌ becomes negative, then the residue will underflow and have to be wrapped around, which requires a modulo reduction operation. To prevent the occurrence of both overflow and underflow cases, we need the centered (i.e., signed) residue representation.