Zola2022-10-11T00:00:00+00:00/atom.xmlWhy copyleft?2022-10-11T00:00:00+00:002022-10-11T00:00:00+00:00Unknown/blog/why-copyleft/<blockquote>
<p>Copyleft is a general method for making a program (or other work) <a href="https://www.gnu.org/philosophy/free-sw.html">free</a> (in the sense of freedom, not “zero price”), and requiring all modified and extended versions of the program to be free as well.</p>
<p>GNU, <a href="https://www.gnu.org/licenses/copyleft.html">What is copyleft?</a></p>
</blockquote>
<p>Developing <em>libre</em>* software means contributing to the common good; enriching the Humanity's capability to compute things and handle data; potentially helping anyone, from the computer nerd to the final user, and even more. (* "libre" is the French for "free as in freedom", used to disambiguate with "free of charge")</p>
<p>Unfortunately, it also means enabling anyone to use the common good to their sole benefit and against the whole community. Think of the giants of the informational capitalism: the computing infrastructure of the libre's worst enemies depends heavily on libre software, Android is based on Linux but flouts user's freedoms, etc.</p>
<p>I would like my work to modestly contribute to the causes I defend, notably to a more free and more egalitarian society, instead of a capitalist empire which vampirizes and destructs the common good.</p>
<blockquote>
<p>Affirming the legitimacy by principle of the informational common good, and the right of anyone to contribute to it being sure that what they put into it will remain common, affirming the right of everyone to access it and to use it, may seem useless as obvious it is. However, it is the basis of the proposed radical reformism, and the changes in the terms of the debate are considerable.</p>
<p>Philippe Aigrain, <em>Cause commune</em>, 2005, Fayard (p151) (approximately translated from French by me)</p>
</blockquote>
<p>This is why I formally forbid you, in some cases and as long as possible, to privatize my work, to subtract it from the common good, to restrict its users' freedoms. This is not a restriction of your freedom, but a protection of the users' freedoms.</p>
<p>Thanks to all the contributors to the common good. ♥</p>
Standalone Atmega328P guide2022-09-12T00:00:00+00:002022-09-12T00:00:00+00:00Unknown/blog/atmega328p-standalone/<p>This guide describes how to burn a program into an Atmega328P microcontroller, using an Arduino board as programmer and an external 16MHz oscillator. It's the result of the frustration that every single time I wanted to to this, it was a struggle because I couldn't find any <em>complete</em> tutorial. At least, the following works for me.</p>
<h2 id="materials-needed">Materials needed</h2>
<ul>
<li>Atmega328P (the P matters)</li>
<li>Arduino board (I used an Arduino Micro)</li>
<li>16MHz oscillator</li>
<li>2× 22pF capacitors</li>
<li>10kΩ resistor</li>
<li>100µF capacitor</li>
</ul>
<h3 id="notes">Notes</h3>
<p>If you don't have any 22pF capacitor, you can salvage some capacitors from an old device (e.g. there are plenty in videotape readers). Unfortunately through-hole capacitors with this value look pretty rare, so you may need to salvage a bunch of unmarked surface-mounted ones and <a href="https://www.instructables.com/Capacitance-Meter/">build a simple Arduino-based capacitance meter</a> to find the wanted ones.</p>
<h2 id="circuit">Circuit</h2>
<img class="float_img" alt="Circuit for programming the Atmega using an Arduino." src="circuit.png" style="max-height:100vh;max-width:100%;"/>
<p>Check Atmega328P's pinout <a href="/blog/atmega328p-standalone/atmega328p.pdf">in the datasheet</a>.</p>
<ul>
<li>Connect the MOSI, MISO, SCK(=SCLK) pins on the Arduino to the corresponding ones on the Atmega. (on Arduino Uno, they are respectively on pins 11, 12, 13)</li>
<li>Connect Arduino pin 10 to Atmega's Reset pin.</li>
<li>Connect each pin on the oscillator to the XTAL/TOSC pins on the Atmega, and place a 22pF capacitor between each of these two pins and the GND.</li>
<li>Connect the GNDs together. Connect Atmega's VCC, Atmega's AVCC and Arduino's +5V together.</li>
</ul>
<p>Triple-check the wiring. MOSI goes on MOSI and MISO goes on MISO, they are not swapped.</p>
<h3 id="for-normal-operation">For normal operation</h3>
<p>The following connections are only needed when the microcontroller is disconnected from the Arduino.</p>
<ul>
<li>Place a pull-up resistor on the Reset pin (10kΩ resistor between Reset and VCC).</li>
<li>Place a 100µF capacitor between GND and VCC.</li>
<li>The oscillator and ceramic capacitors are still needed.</li>
<li>VCC and AVCC still have to be connected.</li>
</ul>
<h2 id="program">Program</h2>
<p>I'm using the Arduino IDE.</p>
<p>First, we program the Arduino board to make it operating as a relay between the computer and the microcontroller:</p>
<ol>
<li>Open the example sketch <code>ArduinoISP</code>.</li>
<li>If using an Arduino Uno, uncomment the line <code>#define USE_OLD_STYLE_WIRING</code>.</li>
<li>Choose your programmer board as board type (<em>Arduino Micro</em> in my case).</li>
<li>Choose a regular programmer (typically <em>AVR ISP</em>).</li>
<li>Upload the sketch normally.</li>
</ol>
<p>Now we can program the microcontroller:</p>
<ol>
<li>Open the wanted sketch. (or start with the <code>Blink</code> example)</li>
<li>Choose <em>Arduino Uno</em> as board type. (even if you're using another board as a programmer; it's because a standalone Atmega328P with a 16MHz oscillator behaves like an Arduino Uno)</li>
<li>Choose <em>Arduino as ISP</em> as programmer.</li>
<li>If your microcontroller doesn't contain a bootloader yet, upload the bootloader using <em>Tools -> Burn bootloader</em>.</li>
<li>Upload the sketch using <em>Sketch -> Upload using programmer</em>.</li>
</ol>
Homomorphic encryption2022-03-04T00:00:00+00:002022-03-04T00:00:00+00:00Unknown/blog/homomorphic-encryption/<p>$$f:(G,*)\longrightarrow (G',\star)\quad|\quad\forall (g,h)\in G^2,~f(g *h)=f(g)\star f(h)$$</p>
<p>This document is accessible to a student in first year of mathematics. It briefly introduces homomorphic encryption, some examples and its applications.</p>
<p><a href="//cloud.txmn.tk/index.php/s/EygkDWqCsZLiTaL/download?path=&files=mss.pdf">Read PDF (French)</a></p>