Modular C
C◼F257◼Z—47: symbols inserted from C◼snippet◼modulo.
+ Collaboration diagram for C◼F257◼Z—47: symbols inserted from C◼snippet◼modulo.:
typedef _Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
 
C◼F257◼𝔽—47 C◼F257◼generator—47 = C◼snippet◼modulo◼generator_default
 A generator of the multiplicative group. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot (C◼F257◼𝔽—47 a)
 Map a into ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—add (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—sub (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—prod (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—div (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—mod (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Operation in the ring ℤn. More...
 
_Bool C◼F257◼𝔽—47◼_Operator—eq (C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
 Equality in the ring ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—notnot (C◼F257◼𝔽—47 a)
 Test if non-zero in ℤn. More...
 
C◼F257◼𝔽—47 C◼F257◼order—47 (C◼F257◼𝔽—47 x)
 Compute the order of element . More...
 

Detailed Description

See also
C◼snippet◼modulo snippet: identifiers inserted directly to an importer for details
This import uses the following slot(s)
slotreplacement
C◼snippet◼modulo◼modC◼F257◼MOD—47
C◼snippet◼modulo◼contextC◼F257◼𝔽—47
C◼snippet◼modulo◼typeC◼F257◼𝔽—47
C◼snippet◼modulo◼orderC◼F257◼order—47
C◼snippet◼modulo◼generatorC◼F257◼generator—47
C◼snippet◼modulo◼generator_defaultuses default

Typedef Documentation

§ C◼F257◼𝔽—47

typedef _Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47

Definition at line 11040 of file C-F257.c.

Function Documentation

§ C◼F257◼order—47()

C◼F257◼𝔽—47 C◼F257◼order—47 ( C◼F257◼𝔽—47  x)

Compute the order of element .

The order is the smallest number r such that $x^{r} \mod n$.

Definition at line 11119 of file C-F257.c.

References C◼F257◼𝔽—47◼_Operator—add(), C◼F257◼𝔽—47◼_Operator—eq(), C◼F257◼𝔽—47◼_Operator—notnot(), and C◼F257◼𝔽—47◼_Operator—prod().

11119  {
11120 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11121  if (¬(C◼F257◼𝔽—47◼_Operator—notnot(x ))) return 0;
11122  C◼F257◼𝔽—47 y = x;
11123  for (C◼F257◼𝔽—47 i = 1; i; ((i )=(C◼F257◼𝔽—47◼_Operator—add(i , 1)))) {
11124 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11125  if (C◼F257◼𝔽—47◼_Operator—eq(y , 1 )) return i;
11126  ((y )=(C◼F257◼𝔽—47◼_Operator—prod(y , x )));
11127  }
11128  // should not be reached
11129  return 0;
11130 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—prod(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Operation in the ring ℤn.
Definition: C-F257.c:11081
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—notnot(C◼F257◼𝔽—47 a)
Test if non-zero in ℤn.
Definition: C-F257.c:11103
_Bool C◼F257◼𝔽—47◼_Operator—eq(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Equality in the ring ℤn.
Definition: C-F257.c:11098
_Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
Definition: C-F257.c:11040
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—add(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Operation in the ring ℤn.
Definition: C-F257.c:11069
+ Here is the call graph for this function:

§ C◼F257◼𝔽—47◼_Operator—add()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—add ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Operation in the ring ℤn.

Definition at line 11069 of file C-F257.c.

References C◼F257◼𝔽—47◼_Operator—bnotbnot().

Referenced by C◼F257◼order—47().

11069  {
11070 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11071  C◼F257◼𝔽—47 ret = a + b;
11073 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot(C◼F257◼𝔽—47 a)
Map a into ℤn.
Definition: C-F257.c:11064
_Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
Definition: C-F257.c:11040
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—bnotbnot()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot ( C◼F257◼𝔽—47  a)
inline

Map a into ℤn.

Definition at line 11064 of file C-F257.c.

Referenced by C◼F257◼𝔽—47◼_Operator—add(), C◼F257◼𝔽—47◼_Operator—eq(), and C◼F257◼𝔽—47◼_Operator—prod().

11064  {
11065 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11066  return a % _Intern◼_I584Rsma◼C◼F257◼Z—47◼mod₀;
11067 }
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—div()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—div ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Operation in the ring ℤn.

Definition at line 11087 of file C-F257.c.

Referenced by C◼F257◼𝔽—47◼_Operator—mod().

11087  {
11088 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11089  C◼F257◼𝔽—47 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—47◼inverse(b);
11091 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot(C◼F257◼𝔽—47 a)
Map a into ℤn.
Definition: C-F257.c:11064
_Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
Definition: C-F257.c:11040
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—eq()

_Bool C◼F257◼𝔽—47◼_Operator—eq ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Equality in the ring ℤn.

Definition at line 11098 of file C-F257.c.

References C◼F257◼𝔽—47◼_Operator—bnotbnot().

Referenced by C◼F257◼order—47().

11098  {
11099 #line 131 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11101 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot(C◼F257◼𝔽—47 a)
Map a into ℤn.
Definition: C-F257.c:11064
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—mod()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—mod ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Operation in the ring ℤn.

Definition at line 11093 of file C-F257.c.

References C◼F257◼𝔽—47◼_Operator—div(), C◼F257◼𝔽—47◼_Operator—prod(), and C◼F257◼𝔽—47◼_Operator—sub().

11093  {
11094 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11096 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—div(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Operation in the ring ℤn.
Definition: C-F257.c:11087
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—prod(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Operation in the ring ℤn.
Definition: C-F257.c:11081
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—sub(C◼F257◼𝔽—47 a, C◼F257◼𝔽—47 b)
Operation in the ring ℤn.
Definition: C-F257.c:11075
+ Here is the call graph for this function:

§ C◼F257◼𝔽—47◼_Operator—notnot()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—notnot ( C◼F257◼𝔽—47  a)
inline

Test if non-zero in ℤn.

Definition at line 11103 of file C-F257.c.

Referenced by C◼F257◼order—47().

11103  {
11104 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11105  return ‼C◼F257◼𝔽—47◼_Operator—bnotbnot(a);
11106 }
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—prod()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—prod ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Operation in the ring ℤn.

Definition at line 11081 of file C-F257.c.

References C◼F257◼𝔽—47◼_Operator—bnotbnot().

Referenced by C◼F257◼order—47(), and C◼F257◼𝔽—47◼_Operator—mod().

11081  {
11082 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11083  C◼F257◼𝔽—47 ret = a * b;
11085 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot(C◼F257◼𝔽—47 a)
Map a into ℤn.
Definition: C-F257.c:11064
_Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
Definition: C-F257.c:11040
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—47◼_Operator—sub()

C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—sub ( C◼F257◼𝔽—47  a,
C◼F257◼𝔽—47  b 
)
inline

Operation in the ring ℤn.

Definition at line 11075 of file C-F257.c.

Referenced by C◼F257◼𝔽—47◼_Operator—mod().

11075  {
11076 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11077  C◼F257◼𝔽—47 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—47◼mod₀ - b);
11079 }
C◼F257◼𝔽—47 C◼F257◼𝔽—47◼_Operator—bnotbnot(C◼F257◼𝔽—47 a)
Map a into ℤn.
Definition: C-F257.c:11064
_Intern◼_I584Rsma◼C◼F257◼Z—47◼type₀ C◼F257◼𝔽—47
Definition: C-F257.c:11040
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—47

A generator of the multiplicative group.

Remarks
This will only be computed automatically at program startup, if ◼C◼snippet◼modulo◼max_find is set to a high enough value.

Definition at line 11139 of file C-F257.c.