Modular C
C◼F257◼Z—223: symbols inserted from C◼snippet◼modulo.
+ Collaboration diagram for C◼F257◼Z—223: symbols inserted from C◼snippet◼modulo.:
typedef _Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
 
C◼F257◼𝔽—223 C◼F257◼generator—223 = C◼snippet◼modulo◼generator_default
 A generator of the multiplicative group. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—bnotbnot (C◼F257◼𝔽—223 a)
 Map a into ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—add (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—sub (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—prod (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—div (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—mod (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Operation in the ring ℤn. More...
 
_Bool C◼F257◼𝔽—223◼_Operator—eq (C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
 Equality in the ring ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—notnot (C◼F257◼𝔽—223 a)
 Test if non-zero in ℤn. More...
 
C◼F257◼𝔽—223 C◼F257◼order—223 (C◼F257◼𝔽—223 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—223
C◼snippet◼modulo◼contextC◼F257◼𝔽—223
C◼snippet◼modulo◼typeC◼F257◼𝔽—223
C◼snippet◼modulo◼orderC◼F257◼order—223
C◼snippet◼modulo◼generatorC◼F257◼generator—223
C◼snippet◼modulo◼generator_defaultuses default

Typedef Documentation

§ C◼F257◼𝔽—223

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

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

Function Documentation

§ C◼F257◼order—223()

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

Compute the order of element .

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

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

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

3163  {
3164 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3165  if (¬(C◼F257◼𝔽—223◼_Operator—notnot(x ))) return 0;
3166  C◼F257◼𝔽—223 y = x;
3167  for (C◼F257◼𝔽—223 i = 1; i; ((i )=(C◼F257◼𝔽—223◼_Operator—add(i , 1)))) {
3168 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3169  if (C◼F257◼𝔽—223◼_Operator—eq(y , 1 )) return i;
3171  }
3172  // should not be reached
3173  return 0;
3174 }
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—prod(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Operation in the ring ℤn.
Definition: C-F257.c:3125
_Bool C◼F257◼𝔽—223◼_Operator—eq(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Equality in the ring ℤn.
Definition: C-F257.c:3142
_Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
Definition: C-F257.c:3084
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—add(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Operation in the ring ℤn.
Definition: C-F257.c:3113
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—notnot(C◼F257◼𝔽—223 a)
Test if non-zero in ℤn.
Definition: C-F257.c:3147
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

3113  {
3114 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3115  C◼F257◼𝔽—223 ret = a + b;
3117 }
_Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
Definition: C-F257.c:3084
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—bnotbnot(C◼F257◼𝔽—223 a)
Map a into ℤn.
Definition: C-F257.c:3108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

3108  {
3109 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3110  return a % _Intern◼_I584Rsma◼C◼F257◼Z—223◼mod₀;
3111 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

3131  {
3132 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3133  C◼F257◼𝔽—223 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—223◼inverse(b);
3135 }
_Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
Definition: C-F257.c:3084
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—bnotbnot(C◼F257◼𝔽—223 a)
Map a into ℤn.
Definition: C-F257.c:3108
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

3137  {
3138 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3140 }
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—prod(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Operation in the ring ℤn.
Definition: C-F257.c:3125
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—div(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Operation in the ring ℤn.
Definition: C-F257.c:3131
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—sub(C◼F257◼𝔽—223 a, C◼F257◼𝔽—223 b)
Operation in the ring ℤn.
Definition: C-F257.c:3119
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

3147  {
3148 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3149  return ‼C◼F257◼𝔽—223◼_Operator—bnotbnot(a);
3150 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

3125  {
3126 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3127  C◼F257◼𝔽—223 ret = a * b;
3129 }
_Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
Definition: C-F257.c:3084
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—bnotbnot(C◼F257◼𝔽—223 a)
Map a into ℤn.
Definition: C-F257.c:3108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

3119  {
3120 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
3121  C◼F257◼𝔽—223 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—223◼mod₀ - b);
3123 }
_Intern◼_I584Rsma◼C◼F257◼Z—223◼type₀ C◼F257◼𝔽—223
Definition: C-F257.c:3084
C◼F257◼𝔽—223 C◼F257◼𝔽—223◼_Operator—bnotbnot(C◼F257◼𝔽—223 a)
Map a into ℤn.
Definition: C-F257.c:3108
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—223

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 3183 of file C-F257.c.