Advances in Alternative Non-Adjacent Form Representations Gildas - - PowerPoint PPT Presentation

advances in alternative non adjacent form representations
SMART_READER_LITE
LIVE PREVIEW

Advances in Alternative Non-Adjacent Form Representations Gildas - - PowerPoint PPT Presentation

Preliminaries Theoretical Results Indocrypt, December 20-22, 2004 Algorithmic Aspects Conclusion Advances in Alternative Non-Adjacent Form Representations Gildas Avoine, Jean Monnerat, and Thomas Peyrin EPFL Lausanne, Switzerland COLE


slide-1
SLIDE 1

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Indocrypt, December 20-22, 2004

Advances in Alternative Non-Adjacent Form Representations

Gildas Avoine, Jean Monnerat, and Thomas Peyrin

EPFL Lausanne, Switzerland

ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-2
SLIDE 2

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Outline

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-3
SLIDE 3

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Preliminaries

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-4
SLIDE 4

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Integer Representations Binary representation n = ai2i where ai ∈ {0, 1} e.g. (13)10 = (001101)2 = (1101)2. Unicity: The most significant bit is not 0. Ternary representation n = ai2i where ai ∈ {0, 1, ¯ 1} e.g. (13)10 = (100¯ 1¯ 1)2 = (1¯ 1000¯ 1¯ 1)2 = (10¯ 101)2. Unicity: For any two adjacent digits, at least one is zero and the most significant digit is not 0 [Reitwiesner, 1960].

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-5
SLIDE 5

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Foundations {0, 1, ¯ 1} can be generalized to {0, 1, x}. Improvement of [Muir and Stinson, 2003] The canonical representation of an integer using {0, 1, x} is defined as in the case {0, 1, ¯ 1}: For any two adjacent digits, at least one is zero and the most significant digit is not 0. Such a representation is called the {0, 1, x}-Non-Adjacent Form (NAF), if it exists. Which sets D = {0, 1, x} where x ∈ Z are such that every positive integer has a D-NAF? Such a set {0, 1, x} is called a Non-Adjacent Digit Set (NADS).

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-6
SLIDE 6

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Known NADS {0, 1, ¯ 1} {0, 1, 3} {0, 1, −5}, {0, 1, −13}, {0, 1, −17}, {0, 1, −25}, etc.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-7
SLIDE 7

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Known NADS {0, 1, ¯ 1} {0, 1, 3} → In the following, we will consider x negative {0, 1, −5}, {0, 1, −13}, {0, 1, −17}, {0, 1, −25}, etc.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-8
SLIDE 8

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Infinite Families Example of infinite family of NADS [Muir and Stinson, 2003]: Let x be a negative integer such that x ≡ 3 (mod 4) and x = 7 − 2t, t ≥ 3, {0, 1, x} is a NADS iff t is odd e.g. -1, -25, -121, etc. Example of infinite family of NON-NADS [Muir and Stinson, 2003]: Let x be a negative integer, if 3−x

4

= 11 · 2i with i ≥ 0, then {0, 1, x} is a not a NADS (so called NON-NADS) e.g. -41, -85, -173, etc.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-9
SLIDE 9

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

NADS How to determine whether or not a set D = {0, 1, x} is a NADS?

Definition

D is a NADS iff every positive integer has a D-NAF.

Theorem (Muir and Stinson)

If every positive integer in [0, ⌊−x/3⌋] has a D-NAF, then D is a NADS.

Theorem (Muir and Stinson)

If every positive integer in [0, ⌊−x/3⌋] and equal to 3 modulo 4 has a D-NAF, then D is a NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-10
SLIDE 10

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

NAF How to determine whether or not an integer n has a D-NAF?

Theorem

A positive integer n has a D-NAF iff, fD(n) has a D-NAF, where fD(n) =

n 4

if n ≡ 0 (mod 4) fD(n) =

n−1 4

if n ≡ 1 (mod 4) fD(n) =

n 2

if n ≡ 2 (mod 4) fD(n) =

n−x 4

if n ≡ 3 (mod 4)

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-11
SLIDE 11

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Graph of n Gn : n − → fD(n) − → f 2

D(n) −

→ f 3

D(n) −

→ . . . − → 0 f 4

D(n)

ւ տ Gn : n − → fD(n) − → f 2

D(n)

− → f 3

D(n)

Either fD(n) reaches 0 or fD(n) loops because: fD(n) ≤ −x

3 when n is in the search domain

0 is the only fixpoint of fD

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-12
SLIDE 12

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Graph of n Gn : n − → fD(n) − → f 2

D(n) −

→ f 3

D(n) −

→ . . . − → 0 f 4

D(n)

ւ տ Gn : n − → fD(n) − → f 2

D(n)

− → f 3

D(n)

Either fD(n) reaches 0 or fD(n) loops because: fD(n) ≤ −x

3 when n is in the search domain

0 is the only fixpoint of fD A positive integer n has a D-NAF iff Gn does not contain cycle.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-13
SLIDE 13

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Theoretical Results

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-14
SLIDE 14

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Contents Search domain Generators of infinite families of NON-NADS Worst NON-NADS

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-15
SLIDE 15

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Search Domain

Theorem

If every positive integer in [0, ⌊−x/3⌋] has a D-NAF, then D is a NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-16
SLIDE 16

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Search Domain

Theorem

If 3 ∤ x and every positive integer in [0, ⌊−x/3⌋] has a D-NAF, then D is a NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-17
SLIDE 17

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Search Domain

Theorem

If 3 ∤ x and every positive integer in [0, ⌊−x/6⌋] has a D-NAF, then D is a NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-18
SLIDE 18

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Search Domain

Theorem

If 3 ∤ x and every positive integer in [0, ⌊−x/6⌋] has a D-NAF, then D is a NADS.

Theorem

If 3 ∤ x and 7 ∤ x and every positive integer in [0, ⌊−x/12⌋] ∪ [⌊−x/7⌋, ⌊−x/6⌋] has a D-NAF, then D is a NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-19
SLIDE 19

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Generators of NON-NADS n has a D-NAF if and only if Gn does not contain any cycle. If it exists n such that Gn contains a cycle, D is not a NADS. Instead of looking for NADS, we look for NON-NADS,

  • btaining (theoretically) the NADS by completion.

We consider a cycle of a given form and deduce the x’s for which it exists an n which lies in this cycle.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-20
SLIDE 20

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Generators of NON-NADS We choose the length t of the cycle and solve f t

D(n) = n.

Define f0(n) = n

4, f1(n) = n−1 4 , f2(n) = n 2, and f3(n) = n−x 4 .

We choose the form of the cycle and solve f t

D(n) = fit ◦ fit−1 ◦ . . . fi1(n) = n,

for some chosen ik ∈ {0, 1, 2, 3} for k = 1, 2 . . . , t. Such a cycle is denoted as i1|i2| . . . |it.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-21
SLIDE 21

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

2-cycles We have 3 possible cycles of length 2, namely 3|0, 3|1 and 3|2. They lead to the equations n−x

16 = n, n−x−4 16

= n and

n−x 8

= n. Since n ≡ 3 (mod 4), we can set n = 4k − 1.

Theorem

If x = −60k + 15, x = −60k + 11 or x = −28k + 7 with k ∈ N, then {0, 1, x} is a NON-NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-22
SLIDE 22

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

t-Cycles We apply our method to a cycle of length t of the form 3|3|3| . . . |3|0. We solve f0 ◦ f t−1

3

(n) = n for t ≥ 2

Theorem

Let t ≥ 2 and k > 0 be two integers and x = −(4k − 1)(22t−1 − 1). Then {0, 1, x} is a NON-NADS.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-23
SLIDE 23

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

NADS Density

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-24
SLIDE 24

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Worst NON-NADS

Definition

Let x be a negative integer such that x ≡ 3 (mod 4). {0, 1, x} is a worst NON-NADS if for all n ≤ − x

3 with n ≡ 3 (mod 4), n has

not {0, 1, x}-NAF.

Theorem

Let x be a negative integer such that x ≡ 3 (mod 4). {0, 1, x} is a worst NON-NADS if and only if there exists i ≥ 2 such that (4mi − 1) < −x < (3 · 2i), where mi :=      2 · 2i−1

3

for i even

2i+1−1 3

for i odd

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-25
SLIDE 25

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Algorithmic Aspects

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-26
SLIDE 26

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Improvements Improvements of the search domain

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-27
SLIDE 27

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Improvements Improvements of the search domain Generators of NON-NADS as a sieve (with an optimal cycle length tmax)

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-28
SLIDE 28

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Improvements Improvements of the search domain Generators of NON-NADS as a sieve (with an optimal cycle length tmax) Worst NON-NADS

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-29
SLIDE 29

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Improvements Improvements of the search domain Generators of NON-NADS as a sieve (with an optimal cycle length tmax) Worst NON-NADS Memoization techniques

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-30
SLIDE 30

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Memoization Memoization consists of remembering function calls and the corresponding outputs. The goal is to avoid to call a function several times with the same arguments.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-31
SLIDE 31

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Is-NADS?

Is-NADS?(x) N ← 3 while N ≤ −x

3

do                                      n ← N S ← ∅ while n = 0 do                  if n ∈ S then return false S ← S ∪ {n} n ← fD(n) N ← N + 4 return true

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-32
SLIDE 32

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Is-NADS?

Is-NADS?(x) N ← 3 while N ≤ −x

3

do                                      n ← N S ← ∅ while n = 0 do                  if n ∈ S then return false S ← S ∪ {n} n ← fD(n) N ← N + 4 return true

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-33
SLIDE 33

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Is-NADS?

Is-NADS?(x) N ← 3 while N ≤ −x

3

do                                      n ← N S ← ∅ while n = 0 do                  if n ∈ S then return false S ← S ∪ {n} n ← fD(n) N ← N + 4 return true

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-34
SLIDE 34

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Is-NADS?

Is-NADS?(x) N ← 3 while N ≤ −x

3

do                                      n ← N S ← ∅ while n = 0 do                  if n ∈ S then return false S ← S ∪ {n} n ← fD(n) N ← N + 4 return true

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-35
SLIDE 35

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25)

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-36
SLIDE 36

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25) G3 fD(3) ↓ fD(1) ↓

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-37
SLIDE 37

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25) G3 G7 fD(3) fD(7) ↓ ↓ fD(1) fD(2) ↓ ↓ fD(1) ↓

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-38
SLIDE 38

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25) G3 G7 G11 fD(3) fD(7) fD(11) ↓ ↓ ↓ fD(1) fD(2) fD(3) ↓ ↓ ↓ fD(1) fD(1) ↓ ↓

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-39
SLIDE 39

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25) G3 G7 G11 fD(3) fD(7) fD(11) ↓ ↓ ↓ fD(1) fD(2) fD(3) ↓ ↓ ↓ fD(1) fD(1) ↓ ↓

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-40
SLIDE 40

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Example Evaluation of Is-NADS?(-25) G3 G7 G11 fD(3) fD(7) fD(11) ↓ ↓ ↓ fD(1) fD(2) fD(3) ↓ ↓ ↓ fD(1) fD(1) ↓ ↓

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-41
SLIDE 41

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Memoization Technique Memoization is a straighforward technique (it can be applied because x is fixed at the begining of the evaluation of Is-NADS?(x)). A much more interesting idea is to use memoization over several executions of Is-NADS?. fD(n) depends on x Memoization only when n ≡ 3 (mod 4). For that we define equivalence classes.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-42
SLIDE 42

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Memoization Technique Memoization is a straighforward technique (it can be applied because x is fixed at the begining of the evaluation of Is-NADS?(x)). A much more interesting idea is to use memoization over several executions of Is-NADS?. fD(n) depends on x but only when n ≡ 3 (mod 4). Memoization only when n ≡ 3 (mod 4). For that we define equivalence classes.

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-43
SLIDE 43

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Equivalence Class of 7

29 469 234 465 464 232 233 232 116 468 28 117 116 58 113 112 56 7 14

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-44
SLIDE 44

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Improvements Improvement of the search domain Generators of NON-NADS as a sieve Worst NON-NADS Memoization techniques

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-45
SLIDE 45

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Results

200 400 600 800 1000 1200 1400 1600 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 Time (seconds)

  • x
  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-46
SLIDE 46

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Results

200 400 600 800 1000 1200 1400 1600 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 Time (seconds)

  • x

[MS03]

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-47
SLIDE 47

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Results

200 400 600 800 1000 1200 1400 1600 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 Time (seconds)

  • x

[MS03] [AMP04]

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-48
SLIDE 48

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Results

200 400 600 800 1000 1200 1400 1600 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 Time (seconds)

  • x

[MS03] [MS04] [AMP04]

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-49
SLIDE 49

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Conclusion

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations

slide-50
SLIDE 50

Preliminaries Theoretical Results Algorithmic Aspects Conclusion

Conclusion Reduction of the search domain. Generator of infinite families of NON-NADS. Improvement of the Muir and Stinson algorithm

  • G. Avoine, J. Monnerat, and T. Peyrin

Advances in Alternative Non-Adjacent Form Representations