MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "compare": {
        "fromrevid": 1,
        "torevid": 2,
        "*": "<tr><td colspan=\"2\" class=\"diff-lineno\" id=\"mw-diff-left-l1\" >Line 1:</td>\n<td colspan=\"2\" class=\"diff-lineno\">Line 1:</td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">&lt;strong&gt;MediaWiki has been successfully installed</del>.<del class=\"diffchange diffchange-inline\">&lt;/strong&gt;</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Writing crypto code was never easy.&#160; Unfortunately, nowadays you don't just have to implement the algorithms so that they give the right answers, and make sure that the random numbers are actually random: you also have to make sure that all of your secrets don't leak out the side of your program through instruction timing, an exciting menagerie of cache effects, branch-predictor state, execution unit utilization, or other side channels</ins>.</div></td></tr>\n<tr><td class='diff-marker'>&#160;</td><td class='diff-context'></td><td class='diff-marker'>&#160;</td><td class='diff-context'></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">Consult </del>the <del class=\"diffchange diffchange-inline\">[//meta.wikimedia.org/wiki/Help:Contents User</del>'<del class=\"diffchange diffchange-inline\">s Guide] </del>for <del class=\"diffchange diffchange-inline\">information on using the wiki software</del>.</div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">The best approach we have at </ins>the <ins class=\"diffchange diffchange-inline\">moment for avoiding this kind of leakage is </ins>'<ins class=\"diffchange diffchange-inline\">constant-time programming'.&#160; This discipline involves ensuring that no secrets are ever used to control conditional execution (</ins>for <ins class=\"diffchange diffchange-inline\">example, branches, but also other kinds of predicated instructions are suspect and should be avoided) or used to calculate memory addresses</ins>.</div></td></tr>\n<tr><td class='diff-marker'>&#160;</td><td class='diff-context'></td><td class='diff-marker'>&#160;</td><td class='diff-context'></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">== Getting started ==</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">There doesn't seem to be a proper place anywhere else to collect constant-time programming lore; so these pages are, for the moment, it. This is ''not'' intended to be a gentle introduction: see, for example, </ins>[<ins class=\"diffchange diffchange-inline\">https:</ins>//www.<ins class=\"diffchange diffchange-inline\">youtube</ins>.<ins class=\"diffchange diffchange-inline\">com</ins>/<ins class=\"diffchange diffchange-inline\">watch?v=Q9e6fANUQDY Peter Schwabe's excellent talk at SchmooCon 2015</ins>] <ins class=\"diffchange diffchange-inline\">for that.</ins></div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* </del>[//www.<del class=\"diffchange diffchange-inline\">mediawiki</del>.<del class=\"diffchange diffchange-inline\">org</del>/<del class=\"diffchange diffchange-inline\">wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list</del>]</div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div>* <del class=\"diffchange diffchange-inline\">[</del>//<del class=\"diffchange diffchange-inline\">www</del>.<del class=\"diffchange diffchange-inline\">mediawiki</del>.<del class=\"diffchange diffchange-inline\">org</del>/<del class=\"diffchange diffchange-inline\">wiki/Special:MyLanguage</del>/<del class=\"diffchange diffchange-inline\">Manual:FAQ MediaWiki FAQ]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">== Masking fundamentals ==</ins></div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div>* <del class=\"diffchange diffchange-inline\">[https:</del>//<del class=\"diffchange diffchange-inline\">lists</del>.<del class=\"diffchange diffchange-inline\">wikimedia.org</del>/<del class=\"diffchange diffchange-inline\">mailman/listinfo</del>/<del class=\"diffchange diffchange-inline\">mediawiki</del>-<del class=\"diffchange diffchange-inline\">announce MediaWiki release mailing list]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div>* <del class=\"diffchange diffchange-inline\">[</del>/<del class=\"diffchange diffchange-inline\">/www</del>.<del class=\"diffchange diffchange-inline\">mediawiki.org</del>/<del class=\"diffchange diffchange-inline\">wiki</del>/<del class=\"diffchange diffchange-inline\">Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Making do without conditional execution just isn't going to cut it.&#160; In place of conditional assignments, we often use ''mask variables'', which we can arrange to be either zero or all-bits-set -- i.e., two's complement \u22121.&#160; Then we can replace</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> if (cond) z = x;</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> else z = y;</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">by</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> /* set m_cond somehow </ins>*/</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> z = (x&amp;m_cond) | (y&amp;~mcond);</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">The remaining trick is to set up the mask.&#160; The best way I know to do this is to start by arranging for the ''top'' bit in some variable to be set or clear according to the desired condition and then performing an arithmetic right shift; the other bits don't matter and can be anything. An arithmetic shift is often free in ARM code, and cheap in x86; unfortunately, C doesn't admit the existence of such a thing.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">I'm assuming throughout that we're working with unsigned integers of some ''known'' bit width, say &lt;code&gt;NBITS&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt;</ins>. <ins class=\"diffchange diffchange-inline\"> Then</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> static inline unsigned signprop(unsigned x)</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">&#160;  { x &gt;&gt;= NBITS - 1; x ^= 1; x--; return (x); }</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">calculates the desired result, and will be recognized as an arithmetic right shift by both GCC and Clang</ins>. <ins class=\"diffchange diffchange-inline\"> It isn't recognized by '''armcc''', and I don't know how to write a ''portable'' arithmetic right shift which '''armcc''' will compile efficiently.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">== Boolean canonification ==</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Suppose that you have a variable &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; you know to be zero or nonzero according to some desired condition, and you want to turn it into a mask.&#160; If we can get the nonzeroness to the topmost bit then we can use &lt;code&gt;signprop&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; above and we're done.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">The following is the best I've come up but it's not very nice.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\"> static inline unsigned nonzerop(unsigned x)</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">&#160;  { x |= x &lt;&lt; 1; x &gt;&gt;= 1; x--; return (~signprop(x)); }</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Here's how it works.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>* <ins class=\"diffchange diffchange-inline\">The OR arranges for &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; to be not equal to 1.&#160; If &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; was zero to begin with, it stays zero; otherwise it has some bit set ''other'' than the bottom bit</ins>.</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">* The shift makes sure that the ''top'' bit is clear while preserving &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt;'s zero-ness.&#160; If the original &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; was zero, then it's still zero; otherwise it's some nonzero value </ins>-<ins class=\"diffchange diffchange-inline\">- but it's top bit is definitely clear.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>* <ins class=\"diffchange diffchange-inline\">The decrement sets &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt;'s top bit if and only if it was zero to begin with</ins>.</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">* Now &lt;code&gt;x&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; is ready to be passed to &lt;code&gt;signprop&lt;</ins>/<ins class=\"diffchange diffchange-inline\">code&gt; to turn it into a mask; only the sense is wrong, so we must invert it.</ins></div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>&#160;</div></td></tr>\n<tr><td colspan=\"2\">&#160;</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">This compiles down to four (sequential) instructions, which isn't brilliantly efficient, but I don't know of a better way.&#160; Fortunately, many useful cases don't need full-on boolean canonification.</ins></div></td></tr>\n"
    }
}