projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cc-kem: Fix memory leak in DH KEMs.
[u/mdw/catacomb]
/
mp.h
diff --git
a/mp.h
b/mp.h
index
f6fa14f
..
74b6473
100644
(file)
--- a/
mp.h
+++ b/
mp.h
@@
-866,6
+866,17
@@
extern mp *mp_sqr(mp */*d*/, mp */*a*/);
extern void mp_div(mp **/*qq*/, mp **/*rr*/, mp */*a*/, mp */*b*/);
extern void mp_div(mp **/*qq*/, mp **/*rr*/, mp */*a*/, mp */*b*/);
+/* --- @mp_exp@ --- *
+ *
+ * Arguments: @mp *d@ = fake destination
+ * @mp *a@ = base
+ * @mp *e@ = exponent
+ *
+ * Returns: Result, %$a^e$%.
+ */
+
+extern mp *mp_exp(mp */*d*/, mp */*a*/, mp */*e*/);
+
/* --- @mp_odd@ --- *
*
* Arguments: @mp *d@ = pointer to destination integer
/* --- @mp_odd@ --- *
*
* Arguments: @mp *d@ = pointer to destination integer
@@
-957,6
+968,9
@@
extern int mp_jacobi(mp */*a*/, mp */*n*/);
* work if %$p$% is composite: you must factor the modulus, take
* a square root mod each factor, and recombine the results
* using the Chinese Remainder Theorem.
* work if %$p$% is composite: you must factor the modulus, take
* a square root mod each factor, and recombine the results
* using the Chinese Remainder Theorem.
+ *
+ * We guarantee that the square root returned is the smallest
+ * one (i.e., the `positive' square root).
*/
extern mp *mp_modsqrt(mp */*d*/, mp */*a*/, mp */*p*/);
*/
extern mp *mp_modsqrt(mp */*d*/, mp */*a*/, mp */*p*/);