2014-06-08 21:44:14 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
2014-06-08 23:33:25 +00:00
< meta name = "generator" content = "Doxygen 1.8.7" / >
2014-06-08 21:44:14 +00:00
< title > post quantum cryptography: /home/travis/build/hasufell/pqc/src/ntru_poly.h File Reference< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
2014-06-08 23:33:25 +00:00
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
2014-06-08 21:44:14 +00:00
< script type = "text/javascript" src = "search/search.js" > < / script >
< script type = "text/javascript" >
$(document).ready(function() { searchBox.OnSelectItem(0); });
< / script >
2014-06-08 23:33:25 +00:00
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
2014-06-08 21:44:14 +00:00
< / head >
< body >
2014-06-08 23:33:25 +00:00
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
2014-06-08 21:44:14 +00:00
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td style = "padding-left: 0.5em;" >
< div id = "projectname" > post quantum cryptography
< / div >
< div id = "projectbrief" > Highly optimized implementation of the NTRUEncrypt algorithm< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
2014-06-08 23:33:25 +00:00
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
2014-06-08 21:44:14 +00:00
< script type = "text/javascript" >
var searchBox = new SearchBox("searchBox", "search",false,'Search');
< / script >
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li > < a href = "index.html" > < span > Main  Page< / span > < / a > < / li >
< li > < a href = "annotated.html" > < span > Data  Structures< / span > < / a > < / li >
< li class = "current" > < a href = "files.html" > < span > Files< / span > < / a > < / li >
< li >
< div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
< img id = "MSearchSelect" src = "search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
< input type = "text" id = "MSearchField" value = "Search" accesskey = "S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
< / span > < span class = "right" >
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" > < img id = "MSearchCloseImg" border = "0" src = "search/close.png" alt = "" / > < / a >
< / span >
< / div >
< / li >
< / ul >
< / div >
< div id = "navrow2" class = "tabs2" >
< ul class = "tablist" >
< li > < a href = "files.html" > < span > File  List< / span > < / a > < / li >
< li > < a href = "globals.html" > < span > Globals< / span > < / a > < / li >
< / ul >
< / div >
2014-06-08 23:33:25 +00:00
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(0)" > < span class = "SelectionMark" >   < / span > All< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(1)" > < span class = "SelectionMark" >   < / span > Data Structures< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(2)" > < span class = "SelectionMark" >   < / span > Files< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(3)" > < span class = "SelectionMark" >   < / span > Functions< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(4)" > < span class = "SelectionMark" >   < / span > Variables< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(5)" > < span class = "SelectionMark" >   < / span > Typedefs< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(6)" > < span class = "SelectionMark" >   < / span > Macros< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(7)" > < span class = "SelectionMark" >   < / span > Pages< / a > < / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< iframe src = "javascript:void(0)" frameborder = "0"
name="MSearchResults" id="MSearchResults">
< / iframe >
2014-06-08 21:44:14 +00:00
< / div >
2014-06-08 23:33:25 +00:00
< div id = "nav-path" class = "navpath" >
< ul >
< li class = "navelem" > < a class = "el" href = "dir_68267d1309a1af8e8297ef4c3efbcdba.html" > src< / a > < / li > < / ul >
< / div >
< / div > <!-- top -->
2014-06-08 21:44:14 +00:00
< div class = "header" >
< div class = "summary" >
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" >
2014-06-08 23:33:25 +00:00
< div class = "title" > ntru_poly.h File Reference< / div > < / div >
2014-06-08 21:44:14 +00:00
< / div > <!-- header -->
< div class = "contents" >
2014-06-08 23:33:25 +00:00
< p > header for < a class = "el" href = "ntru__poly_8c.html" title = "operations on polynomials " > ntru_poly.c< / a >
2014-06-08 21:44:14 +00:00
< a href = "#details" > More...< / a > < / p >
2014-06-08 23:33:25 +00:00
< div class = "textblock" > < code > #include " < a class = "el" href = "ntru__err_8h_source.html" > ntru_err.h< / a > " < / code > < br / >
< code > #include " < a class = "el" href = "ntru__params_8h_source.html" > ntru_params.h< / a > " < / code > < br / >
< code > #include < stdarg.h> < / code > < br / >
< code > #include < stdbool.h> < / code > < br / >
< code > #include < stdint.h> < / code > < br / >
< code > #include < stdlib.h> < / code > < br / >
< code > #include < fmpz_poly.h> < / code > < br / >
2014-06-08 21:44:14 +00:00
< / div > < div class = "textblock" > < div class = "dynheader" >
Include dependency graph for ntru_poly.h:< / div >
< div class = "dyncontent" >
< div class = "center" > < img src = "ntru__poly_8h__incl.png" border = "0" usemap = "#_2home_2travis_2build_2hasufell_2pqc_2src_2ntru__poly_8h" alt = "" / > < / div >
< map name = "_2home_2travis_2build_2hasufell_2pqc_2src_2ntru__poly_8h" id = "_2home_2travis_2build_2hasufell_2pqc_2src_2ntru__poly_8h" >
2014-06-08 23:33:25 +00:00
< area shape = "rect" id = "node3" href = "ntru__err_8h.html" title = "error handling " alt = "" coords = "5,117,83,147" / > < area shape = "rect" id = "node5" href = "ntru__params_8h.html" title = "NTRU parameters. " alt = "" coords = "107,117,211,147" / > < / map >
2014-06-08 21:44:14 +00:00
< / div >
< / div >
< p > < a href = "ntru__poly_8h_source.html" > Go to the source code of this file.< / a > < / p >
< table class = "memberdecls" >
2014-06-08 23:33:25 +00:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "func-members" > < / a >
2014-06-08 21:44:14 +00:00
Functions< / h2 > < / td > < / tr >
2014-06-08 23:33:25 +00:00
< tr class = "memitem:aaaac83ec72414aa208832442657c3520" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#aaaac83ec72414aa208832442657c3520" > fmpz_cmp_si_n< / a > (const fmpz_t f, slong g)< / td > < / tr >
< tr class = "separator:aaaac83ec72414aa208832442657c3520" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a20f86085d5eb5372fd25dc270069d38c" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a20f86085d5eb5372fd25dc270069d38c" > poly_new< / a > (fmpz_poly_t new_poly, int const *const c, const size_t len)< / td > < / tr >
< tr class = "separator:a20f86085d5eb5372fd25dc270069d38c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a27ff2116f70bcbf5028219adcae4c5f0" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a27ff2116f70bcbf5028219adcae4c5f0" > poly_delete< / a > (fmpz_poly_t poly)< / td > < / tr >
< tr class = "separator:a27ff2116f70bcbf5028219adcae4c5f0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a3f53c63383ff301b20dcede0783869a7" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a3f53c63383ff301b20dcede0783869a7" > poly_delete_array< / a > (fmpz_poly_t **poly_array)< / td > < / tr >
< tr class = "separator:a3f53c63383ff301b20dcede0783869a7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a83297bc2ab5b6e7ce42553570dd8268f" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a83297bc2ab5b6e7ce42553570dd8268f" > poly_delete_all< / a > (fmpz_poly_t poly,...)< / td > < / tr >
< tr class = "separator:a83297bc2ab5b6e7ce42553570dd8268f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ae7d0d8364dba689df3fb4904610634cc" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ae7d0d8364dba689df3fb4904610634cc" > fmpz_poly_mod_unsigned< / a > (fmpz_poly_t a, const uint32_t mod)< / td > < / tr >
< tr class = "separator:ae7d0d8364dba689df3fb4904610634cc" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a7c4f5e96355518dc97a23da8f34b661a" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a7c4f5e96355518dc97a23da8f34b661a" > fmpz_poly_mod< / a > (fmpz_poly_t a, const uint32_t mod)< / td > < / tr >
< tr class = "separator:a7c4f5e96355518dc97a23da8f34b661a" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ab1f966fe680d1ce7c19c8c812d1932a7" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ab1f966fe680d1ce7c19c8c812d1932a7" > fmpz_poly_set_coeff_fmpz_n< / a > (fmpz_poly_t poly, slong n, const fmpz_t x)< / td > < / tr >
< tr class = "separator:ab1f966fe680d1ce7c19c8c812d1932a7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a59da1b7962829af8f18d58c05f588606" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a59da1b7962829af8f18d58c05f588606" > fmpz_invmod_ui< / a > (fmpz_t f, const fmpz_t g, const uint32_t mod)< / td > < / tr >
< tr class = "separator:a59da1b7962829af8f18d58c05f588606" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ad2a11e832808ef1cfee0eed1cc02f4b9" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ad2a11e832808ef1cfee0eed1cc02f4b9" > fmpz_add_n< / a > (fmpz_t f, const fmpz_t g, const fmpz_t h)< / td > < / tr >
< tr class = "separator:ad2a11e832808ef1cfee0eed1cc02f4b9" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ae96f479ddd97af709a0ed50817fd3fb3" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ae96f479ddd97af709a0ed50817fd3fb3" > poly_starmultiply< / a > (const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *params, uint32_t modulus)< / td > < / tr >
< tr class = "separator:ae96f479ddd97af709a0ed50817fd3fb3" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ace66beb516186e52f9b5b1ed8a397849" > < td class = "memItemLeft" align = "right" valign = "top" > bool  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ace66beb516186e52f9b5b1ed8a397849" > poly_inverse_poly_q< / a > (const fmpz_poly_t a, fmpz_poly_t Fq, const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *params)< / td > < / tr >
< tr class = "separator:ace66beb516186e52f9b5b1ed8a397849" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ae77b2014df42e5ed612206d5930ac608" > < td class = "memItemLeft" align = "right" valign = "top" > bool  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#ae77b2014df42e5ed612206d5930ac608" > poly_inverse_poly_p< / a > (const fmpz_poly_t a, fmpz_poly_t Fp, const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *params)< / td > < / tr >
< tr class = "separator:ae77b2014df42e5ed612206d5930ac608" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a80a8ce0f2944bc3df94291ef2f781498" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#a80a8ce0f2944bc3df94291ef2f781498" > poly_draw< / a > (const fmpz_poly_t poly)< / td > < / tr >
< tr class = "separator:a80a8ce0f2944bc3df94291ef2f781498" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:aec098d00160d2d502eb1f8a7c3fa5453" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "ntru__poly_8h.html#aec098d00160d2d502eb1f8a7c3fa5453" > poly_draw_pretty< / a > (const fmpz_poly_t poly)< / td > < / tr >
< tr class = "separator:aec098d00160d2d502eb1f8a7c3fa5453" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2014-06-08 21:44:14 +00:00
< / table >
2014-06-08 23:33:25 +00:00
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< div class = "textblock" > < p > header for < a class = "el" href = "ntru__poly_8c.html" title = "operations on polynomials " > ntru_poly.c< / a > < / p >
< p > Header for the internal API of < a class = "el" href = "ntru__poly_8c.html" title = "operations on polynomials " > ntru_poly.c< / a > . < / p >
2014-06-08 21:44:14 +00:00
< p > Definition in file < a class = "el" href = "ntru__poly_8h_source.html" > ntru_poly.h< / a > .< / p >
2014-06-08 23:33:25 +00:00
< / div > < h2 class = "groupheader" > Function Documentation< / h2 >
< a class = "anchor" id = "ad2a11e832808ef1cfee0eed1cc02f4b9" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void fmpz_add_n < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_t  < / td >
< td class = "paramname" > < em > f< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const fmpz_t  < / td >
< td class = "paramname" > < em > g< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const fmpz_t  < / td >
< td class = "paramname" > < em > h< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > The same as fmpz_add() except that it handles NULL pointer for g and h. < / p >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00222" > 222< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "aaaac83ec72414aa208832442657c3520" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > int fmpz_cmp_si_n < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_t  < / td >
< td class = "paramname" > < em > f< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > slong  < / td >
< td class = "paramname" > < em > g< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > The same as fmpz_cmp_si except that it will interpret f as a 0-coefficient if it is a NULL pointer.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > f< / td > < td > the fmpz value to use for comparison < / td > < / tr >
< tr > < td class = "paramname" > g< / td > < td > the signed long integer to use for comparison < / td > < / tr >
< / table >
< / dd >
< / dl >
2014-06-08 23:33:25 +00:00
< dl class = "section return" > < dt > Returns< / dt > < dd > negative value if f < g, positiv evalue if g < f, otherwise 0 < / dd > < / dl >
2014-06-08 21:44:14 +00:00
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00093" > 93< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a59da1b7962829af8f18d58c05f588606" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > int fmpz_invmod_ui < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_t  < / td >
< td class = "paramname" > < em > f< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const fmpz_t  < / td >
< td class = "paramname" > < em > g< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const uint32_t  < / td >
< td class = "paramname" > < em > mod< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Wrapper around fmpz_invmod() where we convert mod to an fmpz_t implicitly.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > f< / td > < td > result [out] < / td > < / tr >
< tr > < td class = "paramname" > g< / td > < td > the inverse < / td > < / tr >
< tr > < td class = "paramname" > mod< / td > < td > the modulo < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00210" > 210< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a7c4f5e96355518dc97a23da8f34b661a" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void fmpz_poly_mod < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const uint32_t  < / td >
< td class = "paramname" > < em > mod< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.< / p >
< p > This also normalises the coefficients to the interval -m/2 < = r < m/2.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > a< / td > < td > the polynom to apply the modulus to < / td > < / tr >
< tr > < td class = "paramname" > mod< / td > < td > the modulus < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00182" > 182< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "ae7d0d8364dba689df3fb4904610634cc" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void fmpz_poly_mod_unsigned < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const uint32_t  < / td >
< td class = "paramname" > < em > mod< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Calls fmpz_poly_get_nmod_poly() and fmpz_poly_set_nmod_poly_unsigned() in a row, so we don't have to deal with the intermediate nmod_poly_t type if we don't need it.< / p >
< p > This also normalises the coefficients to the interval 0 < = r < m.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > a< / td > < td > the polynom to apply the modulus to < / td > < / tr >
< tr > < td class = "paramname" > mod< / td > < td > the modulus < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00166" > 166< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "ab1f966fe680d1ce7c19c8c812d1932a7" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void fmpz_poly_set_coeff_fmpz_n < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > poly< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > slong  < / td >
< td class = "paramname" > < em > n< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const fmpz_t  < / td >
< td class = "paramname" > < em > x< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > The same as fmpz_poly_set_coeff_fmpz() except that it will take care of null-pointer coefficients and use fmpz_poly_set_coeff_si() in that case.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly< / td > < td > the polynom we want to change a coefficient of < / td > < / tr >
< tr > < td class = "paramname" > n< / td > < td > the coefficient we want to set < / td > < / tr >
< tr > < td class = "paramname" > x< / td > < td > the value to assign to the coefficient < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00198" > 198< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a27ff2116f70bcbf5028219adcae4c5f0" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_delete < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > poly< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > This deletes the internal structure of a polynomial, and frees the pointer.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly< / td > < td > the polynomial to delete < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00123" > 123< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a83297bc2ab5b6e7ce42553570dd8268f" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_delete_all < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > poly< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" >   < / td >
< td class = "paramname" > < em > ...< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > This deletes the internal structure of all polynomials, and frees the pointers. You must call this with NULL as last argument!< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly< / td > < td > the polynomial to delete < / td > < / tr >
< tr > < td class = "paramname" > ...< / td > < td > follow up polynomials < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00149" > 149< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a3f53c63383ff301b20dcede0783869a7" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_delete_array < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t **  < / td >
< td class = "paramname" > < em > poly_array< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Delete the internal structure of a polynomial array which must be NULL terminated. It is expected that poly_array is not on the stack and was obtained by a function like ascii_to_poly().< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly_array< / td > < td > the polynomial array < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00131" > 131< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a80a8ce0f2944bc3df94291ef2f781498" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_draw < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > poly< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Draws a polynomial to stdout.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly< / td > < td > draw this < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00574" > 574< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "aec098d00160d2d502eb1f8a7c3fa5453" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_draw_pretty < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > poly< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Draws a polynomial to stdout, in pretty format.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > poly< / td > < td > draw this < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00583" > 583< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "ae77b2014df42e5ed612206d5930ac608" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > bool poly_inverse_poly_p < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > Fp< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *  < / td >
< td class = "paramname" > < em > params< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Compute the inverse of a polynomial in (Z/pZ)[X]/(X^N - 1). See NTRU Cryptosystems Tech Report #014 "Almost Inverses
2014-06-08 23:33:25 +00:00
and Fast NTRU Key Creation."< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > a< / td > < td > polynomial to invert < / td > < / tr >
< tr > < td class = "paramname" > Fp< / td > < td > polynomial [out] < / td > < / tr >
< tr > < td class = "paramname" > params< / td > < td > NTRU parameters < / td > < / tr >
< / table >
< / dd >
< / dl >
2014-06-08 23:33:25 +00:00
< dl class = "section return" > < dt > Returns< / dt > < dd > true if invertible, false if not < / dd > < / dl >
2014-06-08 21:44:14 +00:00
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00409" > 409< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "ace66beb516186e52f9b5b1ed8a397849" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > bool poly_inverse_poly_q < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > Fq< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *  < / td >
< td class = "paramname" > < em > params< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Compute the inverse of a polynomial in modulo a power of 2, which is q. This is based off the pseudo-code for "Inversion
2014-06-08 23:33:25 +00:00
in (Z/2Z)[X](X^N - 1)" and "Inversion in (Z/p^r Z)[X](X^N - 1)". See NTRU Cryptosystems Tech Report #014 "Almost Inverses
and Fast NTRU Key Creation."< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > a< / td > < td > polynomial to invert (is allowed to be the same as param Fq) < / td > < / tr >
< tr > < td class = "paramname" > Fq< / td > < td > polynomial [out] < / td > < / tr >
< tr > < td class = "paramname" > params< / td > < td > NTRU parameters < / td > < / tr >
< / table >
< / dd >
< / dl >
2014-06-08 23:33:25 +00:00
< dl class = "section return" > < dt > Returns< / dt > < dd > true if invertible, false if not < / dd > < / dl >
2014-06-08 21:44:14 +00:00
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00297" > 297< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "a20f86085d5eb5372fd25dc270069d38c" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_new < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > new_poly< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int const *const  < / td >
< td class = "paramname" > < em > c< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const size_t  < / td >
< td class = "paramname" > < em > len< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Initializes and builds a polynomial with the coefficient values of c[] of size len within NTRU parameters and returns a newly allocated polynomial. For an empty polynom, both c and len can be NULL/0.< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > new_poly< / td > < td > the polynomial to initialize and fill with coefficients [out] < / td > < / tr >
< tr > < td class = "paramname" > c< / td > < td > array of polynomial coefficients, can be NULL < / td > < / tr >
< tr > < td class = "paramname" > len< / td > < td > size of the coefficient array, can be 0 < / td > < / tr >
< / table >
< / dd >
< / dl >
2014-06-08 23:33:25 +00:00
< dl class = "section return" > < dt > Returns< / dt > < dd > newly allocated polynomial pointer, must be freed with fmpz_poly_clear() < / dd > < / dl >
2014-06-08 21:44:14 +00:00
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00110" > 110< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
2014-06-08 23:33:25 +00:00
< a class = "anchor" id = "ae96f479ddd97af709a0ed50817fd3fb3" > < / a >
2014-06-08 21:44:14 +00:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
2014-06-08 23:33:25 +00:00
< td class = "memname" > void poly_starmultiply < / td >
2014-06-08 21:44:14 +00:00
< td > (< / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > a< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const fmpz_poly_t  < / td >
< td class = "paramname" > < em > b< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > fmpz_poly_t  < / td >
< td class = "paramname" > < em > c< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const < a class = "el" href = "structntru__params.html" > ntru_params< / a > *  < / td >
< td class = "paramname" > < em > params< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > uint32_t  < / td >
< td class = "paramname" > < em > modulus< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
2014-06-08 23:33:25 +00:00
< / div > < div class = "memdoc" >
2014-06-08 21:44:14 +00:00
< p > Starmultiplication, as follows: c = a * b mod (x^N − 1)< / p >
2014-06-08 23:33:25 +00:00
< dl class = "params" > < dt > Parameters< / dt > < dd >
2014-06-08 21:44:14 +00:00
< table class = "params" >
< tr > < td class = "paramname" > a< / td > < td > polynom to multiply (can be the same as c) < / td > < / tr >
< tr > < td class = "paramname" > b< / td > < td > polynom to multiply < / td > < / tr >
< tr > < td class = "paramname" > c< / td > < td > polynom [out] < / td > < / tr >
< tr > < td class = "paramname" > params< / td > < td > NTRU parameters < / td > < / tr >
< tr > < td class = "paramname" > modulus< / td > < td > whether we use p or q < / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Definition at line < a class = "el" href = "ntru__poly_8c_source.html#l00239" > 239< / a > of file < a class = "el" href = "ntru__poly_8c_source.html" > ntru_poly.c< / a > .< / p >
< / div >
< / div >
< / div > <!-- contents -->
2014-06-08 23:33:25 +00:00
<!-- start footer part -->
2014-06-08 21:44:14 +00:00
< hr class = "footer" / > < address class = "footer" > < small >
2014-06-08 23:33:25 +00:00
Generated on Sun Jun 8 2014 23:33:23 for post quantum cryptography by   < a href = "http://www.doxygen.org/index.html" >
2014-06-08 21:44:14 +00:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / >
2014-06-08 23:33:25 +00:00
< / a > 1.8.7
2014-06-08 21:44:14 +00:00
< / small > < / address >
< / body >
< / html >