Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap NTL's BKZ #3232

Closed
malb opened this issue May 16, 2008 · 12 comments
Closed

wrap NTL's BKZ #3232

malb opened this issue May 16, 2008 · 12 comments

Comments

@malb
Copy link
Member

malb commented May 16, 2008

The BKZ algorithm is a lattice reduction algorithm AFAIK only implemented in NTL.

  -- BKZ: Block Korkin-Zolotarev reduction.
     This is slower, but yields a higher-quality basis,
     i.e., one with shorter vectors.
     See the Schnorr-Euchner paper for a description of this.
     This basically generalizes the LLL reduction condition
     from blocks of size 2 to blocks of larger size.

It enjoys more widespread use in cryptography these days and possibly other areas. Since Sage has Damien Stehle's fast fpLLL library and NTL's BKZ this would make Sage a very nice tool for people who care about these algorithms.

Component: linear algebra

Keywords: editor_malb

Issue created by migration from https://trac.sagemath.org/ticket/3232

@malb
Copy link
Member Author

malb commented May 25, 2008

comment:1

The attached patch wraps the appropriate NTL functions. It has doctests for all new methods. However, someone more familiar with BKZ might want to add an example (possibly #long) which showcases the difference between LLL and BKZ.

@craigcitro
Copy link
Member

Changed keywords from none to editor_malb

@malb
Copy link
Member Author

malb commented Jun 16, 2008

comment:3

Ralf forwarded the review request to a colleague of his. I'll ping him again by the end of the week to see what happened.

@malb
Copy link
Member Author

malb commented Jun 22, 2008

comment:4

Ralf, can you review the patch without the forwarding which now seems pointless?

@malb
Copy link
Member Author

malb commented Jun 25, 2008

comment:5

state of affairs for editorial meeting 26/06/08

I didn't hear back from rpw yet. Maybe another referee could jump in.

@malb malb changed the title wrap NTL's BKZ [under review by rpw] wrap NTL's BKZ Jun 25, 2008
@sagetrac-rpw
Copy link
Mannequin

sagetrac-rpw mannequin commented Jul 7, 2008

Attachment: ntru_2_47.sage.gz

NTRU derived lattice, n=47

@sagetrac-rpw
Copy link
Mannequin

sagetrac-rpw mannequin commented Jul 7, 2008

comment:6

Patch applied against SAGE 3.0.3. Works fine, doctests OK. Successfully tested on some cryptographically relevant toy sample lattices (NTRU derived, one is attached, provided by Markus Rückert).

Two typos found in documentation:

  • permuation -> permutation
  • Gramm-Schmidt -> Gram-Schmidt

@sagetrac-rpw sagetrac-rpw mannequin changed the title [under review by rpw] wrap NTL's BKZ wrap NTL's BKZ Jul 7, 2008
@malb
Copy link
Member Author

malb commented Jul 8, 2008

comment:7

w00t, I'll fix the typos today-ish.

@malb malb changed the title wrap NTL's BKZ [positive review pending typos] wrap NTL's BKZ Jul 8, 2008
@malb
Copy link
Member Author

malb commented Jul 8, 2008

comment:8

To highlight BKZ's features here is a Sage session for the NTRU example rpw provided:

sage: M = eval(open("ntru_2_47.sage").read()[4:])
sage: M
94 x 94 dense matrix over Integer Ring

sage: %time M_BKZ = M.BKZ()
CPU times: user 17.64 s, sys: 0.03 s, total: 17.67 s
Wall time: 17.98 s

sage: %time M_LLL = M.LLL()
CPU times: user 0.30 s, sys: 0.00 s, total: 0.30 s
Wall time: 0.30 s

sage: %time M_LLL_NTL = M.LLL(algorithm="NTL:LLL")
CPU times: user 0.11 s, sys: 0.01 s, total: 0.12 s
Wall time: 0.16 s

sage: sqrt(sum([ a^2 for a in M_BKZ[0] ])).n()
10.1488915650922

sage: sqrt(sum([ a^2 for a in M_LLL[0] ])).n()
23.0000000000000

sage: sqrt(sum([ a^2 for a in M_LLL_NTL[0] ])).n()
23.0000000000000

sage: sqrt(sum([ a^2 for a in M_BKZ[93] ])).n()
20.7364413533277

sage: sqrt(sum([ a^2 for a in M_LLL[93] ])).n()
43.0116263352131

sage: sqrt(sum([ a^2 for a in M_LLL_NTL[93] ])).n()
47.6340214552582

@malb
Copy link
Member Author

malb commented Jul 8, 2008

addresses rpw's review

@malb
Copy link
Member Author

malb commented Jul 8, 2008

comment:9

Attachment: bkz.patch.gz

Typos fixed in updated patch, apply bkz.patch only.

@malb malb changed the title [positive review pending typos] wrap NTL's BKZ wrap NTL's BKZ Jul 8, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jul 15, 2008

comment:10

Merged bkz.patch in Sage 3.0.6.alpha0

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Jul 15, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants