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

Typedef Documentation

§ C◼F257◼𝔽—107

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

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

Function Documentation

§ C◼F257◼order—107()

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

Compute the order of element .

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

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

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

8077  {
8078 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8079  if (¬(C◼F257◼𝔽—107◼_Operator—notnot(x ))) return 0;
8080  C◼F257◼𝔽—107 y = x;
8081  for (C◼F257◼𝔽—107 i = 1; i; ((i )=(C◼F257◼𝔽—107◼_Operator—add(i , 1)))) {
8082 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8083  if (C◼F257◼𝔽—107◼_Operator—eq(y , 1 )) return i;
8085  }
8086  // should not be reached
8087  return 0;
8088 }
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—prod(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Operation in the ring ℤn.
Definition: C-F257.c:8039
_Intern◼_I584Rsma◼C◼F257◼Z—107◼type₀ C◼F257◼𝔽—107
Definition: C-F257.c:7998
_Bool C◼F257◼𝔽—107◼_Operator—eq(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Equality in the ring ℤn.
Definition: C-F257.c:8056
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—add(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Operation in the ring ℤn.
Definition: C-F257.c:8027
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—notnot(C◼F257◼𝔽—107 a)
Test if non-zero in ℤn.
Definition: C-F257.c:8061
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

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

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

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

Map a into ℤn.

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

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

8022  {
8023 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8024  return a % _Intern◼_I584Rsma◼C◼F257◼Z—107◼mod₀;
8025 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

8045  {
8046 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8047  C◼F257◼𝔽—107 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—107◼inverse(b);
8049 }
_Intern◼_I584Rsma◼C◼F257◼Z—107◼type₀ C◼F257◼𝔽—107
Definition: C-F257.c:7998
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—bnotbnot(C◼F257◼𝔽—107 a)
Map a into ℤn.
Definition: C-F257.c:8022
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

8051  {
8052 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8054 }
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—prod(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Operation in the ring ℤn.
Definition: C-F257.c:8039
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—sub(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Operation in the ring ℤn.
Definition: C-F257.c:8033
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—div(C◼F257◼𝔽—107 a, C◼F257◼𝔽—107 b)
Operation in the ring ℤn.
Definition: C-F257.c:8045
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

8061  {
8062 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8063  return ‼C◼F257◼𝔽—107◼_Operator—bnotbnot(a);
8064 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

8039  {
8040 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8041  C◼F257◼𝔽—107 ret = a * b;
8043 }
_Intern◼_I584Rsma◼C◼F257◼Z—107◼type₀ C◼F257◼𝔽—107
Definition: C-F257.c:7998
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—bnotbnot(C◼F257◼𝔽—107 a)
Map a into ℤn.
Definition: C-F257.c:8022
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

8033  {
8034 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8035  C◼F257◼𝔽—107 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—107◼mod₀ - b);
8037 }
_Intern◼_I584Rsma◼C◼F257◼Z—107◼type₀ C◼F257◼𝔽—107
Definition: C-F257.c:7998
C◼F257◼𝔽—107 C◼F257◼𝔽—107◼_Operator—bnotbnot(C◼F257◼𝔽—107 a)
Map a into ℤn.
Definition: C-F257.c:8022
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—107

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