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

Typedef Documentation

§ C◼F257◼𝔽—241

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

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

Function Documentation

§ C◼F257◼order—241()

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

Compute the order of element .

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

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

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

1993  {
1994 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1995  if (¬(C◼F257◼𝔽—241◼_Operator—notnot(x ))) return 0;
1996  C◼F257◼𝔽—241 y = x;
1997  for (C◼F257◼𝔽—241 i = 1; i; ((i )=(C◼F257◼𝔽—241◼_Operator—add(i , 1)))) {
1998 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1999  if (C◼F257◼𝔽—241◼_Operator—eq(y , 1 )) return i;
2001  }
2002  // should not be reached
2003  return 0;
2004 }
_Intern◼_I584Rsma◼C◼F257◼Z—241◼type₀ C◼F257◼𝔽—241
Definition: C-F257.c:1914
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—notnot(C◼F257◼𝔽—241 a)
Test if non-zero in ℤn.
Definition: C-F257.c:1977
_Bool C◼F257◼𝔽—241◼_Operator—eq(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Equality in the ring ℤn.
Definition: C-F257.c:1972
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—prod(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Operation in the ring ℤn.
Definition: C-F257.c:1955
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—add(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Operation in the ring ℤn.
Definition: C-F257.c:1943
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

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

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

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

Map a into ℤn.

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

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

1938  {
1939 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1940  return a % _Intern◼_I584Rsma◼C◼F257◼Z—241◼mod₀;
1941 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

1961  {
1962 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1963  C◼F257◼𝔽—241 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—241◼inverse(b);
1965 }
_Intern◼_I584Rsma◼C◼F257◼Z—241◼type₀ C◼F257◼𝔽—241
Definition: C-F257.c:1914
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—bnotbnot(C◼F257◼𝔽—241 a)
Map a into ℤn.
Definition: C-F257.c:1938
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

1967  {
1968 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1970 }
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—sub(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Operation in the ring ℤn.
Definition: C-F257.c:1949
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—div(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Operation in the ring ℤn.
Definition: C-F257.c:1961
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—prod(C◼F257◼𝔽—241 a, C◼F257◼𝔽—241 b)
Operation in the ring ℤn.
Definition: C-F257.c:1955
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

1977  {
1978 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1979  return ‼C◼F257◼𝔽—241◼_Operator—bnotbnot(a);
1980 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

1955  {
1956 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1957  C◼F257◼𝔽—241 ret = a * b;
1959 }
_Intern◼_I584Rsma◼C◼F257◼Z—241◼type₀ C◼F257◼𝔽—241
Definition: C-F257.c:1914
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—bnotbnot(C◼F257◼𝔽—241 a)
Map a into ℤn.
Definition: C-F257.c:1938
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

1949  {
1950 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1951  C◼F257◼𝔽—241 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—241◼mod₀ - b);
1953 }
_Intern◼_I584Rsma◼C◼F257◼Z—241◼type₀ C◼F257◼𝔽—241
Definition: C-F257.c:1914
C◼F257◼𝔽—241 C◼F257◼𝔽—241◼_Operator—bnotbnot(C◼F257◼𝔽—241 a)
Map a into ℤn.
Definition: C-F257.c:1938
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—241

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