Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
steps.c File Reference
#include "steps.h"
Include dependency graph for steps.c:

Go to the source code of this file.

Functions

void steps_override (int64_t bs, int64_t gs)
void steps (int64_t *bs, int64_t *gs, int64_t l)

Function Documentation

◆ steps()

void steps ( int64_t * bs,
int64_t * gs,
int64_t l )

Definition at line 14 of file steps.c.

15{
16 int64_t b,g;
17
18 if (steps_overridden) {
19 b = steps_override_bs;
20 g = steps_override_gs;
21 } else if (!steps_guess(&b,&g,l)) {
22 b = 0;
23 do {
24 b += 2;
25 g = (l-1)/(4*b);
26 } while (g >= b);
27 }
28
29 /* enforce rules for b,g: */
30
31 if (b < 0) b = 0;
32 if (g < 0) g = 0;
33
34 if (b&1) ++b;
35 if (b)
36 if (g > (l-1)/(4*b))
37 g = (l-1)/(4*b);
38
39 if (!g) b = 0;
40 if (!b) g = 0;
41
42 *bs = b;
43 *gs = g;
44}
#define steps_guess
Definition steps.h:9

References steps_guess.

◆ steps_override()

void steps_override ( int64_t bs,
int64_t gs )

Definition at line 7 of file steps.c.

8{
9 steps_overridden = 1;
10 steps_override_bs = bs;
11 steps_override_gs = gs;
12}