~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize the register dumping machinery while testing assembler code.
[catacomb]
/
math
/
mpmont-exp.c
diff --git
a/math/mpmont-exp.c
b/math/mpmont-exp.c
index
0ea554e
..
ff15b2d
100644
(file)
--- a/
math/mpmont-exp.c
+++ b/
math/mpmont-exp.c
@@
-35,7
+35,7
@@
/* --- @mpmont_expr@ --- *
*
/* --- @mpmont_expr@ --- *
*
- * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context
+ * Arguments: @
const
mpmont *mm@ = pointer to Montgomery reduction context
* @mp *d@ = fake destination
* @mp *a@ = base
* @mp *e@ = exponent
* @mp *d@ = fake destination
* @mp *a@ = base
* @mp *e@ = exponent
@@
-43,7
+43,7
@@
* Returns: Result, %$(a R^{-1})^e R \bmod m$%.
*/
* Returns: Result, %$(a R^{-1})^e R \bmod m$%.
*/
-mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e)
+mp *mpmont_expr(
const
mpmont *mm, mp *d, mp *a, mp *e)
{
mp *x = MP_COPY(mm->r);
mp *spare = (e->f & MP_BURN) ? MP_NEWSEC : MP_NEW;
{
mp *x = MP_COPY(mm->r);
mp *spare = (e->f & MP_BURN) ? MP_NEWSEC : MP_NEW;
@@
-71,7
+71,7
@@
mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e)
/* --- @mpmont_exp@ --- *
*
/* --- @mpmont_exp@ --- *
*
- * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context
+ * Arguments: @
const
mpmont *mm@ = pointer to Montgomery reduction context
* @mp *d@ = fake destination
* @mp *a@ = base
* @mp *e@ = exponent
* @mp *d@ = fake destination
* @mp *a@ = base
* @mp *e@ = exponent
@@
-79,7
+79,7
@@
mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e)
* Returns: Result, %$a^e \bmod m$%.
*/
* Returns: Result, %$a^e \bmod m$%.
*/
-mp *mpmont_exp(mpmont *mm, mp *d, mp *a, mp *e)
+mp *mpmont_exp(
const
mpmont *mm, mp *d, mp *a, mp *e)
{
e = MP_COPY(e);
d = mpmont_mul(mm, d, a, mm->r2);
{
e = MP_COPY(e);
d = mpmont_mul(mm, d, a, mm->r2);
@@
-93,6
+93,10
@@
mp *mpmont_exp(mpmont *mm, mp *d, mp *a, mp *e)
#ifdef TEST_RIG
#ifdef TEST_RIG
+#ifdef ENABLE_ASM_DEBUG
+# include "regdump.h"
+#endif
+
static int texp(dstr *v)
{
mp *m = *(mp **)v[0].buf;
static int texp(dstr *v)
{
mp *m = *(mp **)v[0].buf;
@@
-136,6
+140,9
@@
static test_chunk tests[] = {
int main(int argc, char *argv[])
{
sub_init();
int main(int argc, char *argv[])
{
sub_init();
+#ifdef ENABLE_ASM_DEBUG
+ regdump_init();
+#endif
test_run(argc, argv, tests, SRCDIR "/t/mpmont");
return (0);
}
test_run(argc, argv, tests, SRCDIR "/t/mpmont");
return (0);
}