aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zpow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zpow.c b/src/zpow.c
index 7388bde..f709ff9 100644
--- a/src/zpow.c
+++ b/src/zpow.c
@@ -8,6 +8,12 @@
void
zpow(z_t a, z_t b, z_t c)
{
+ /*
+ * Exponentiation by squaring.
+ *
+ * 7↑19 = 7↑10011₂ = 7↑2⁰ ⋅ 7↑2¹ ⋅ 7↑2⁴ where a↑2↑(n + 1) = (a↑2↑n)².
+ */
+
size_t i, j, n, bits;
zahl_char_t x;