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

Typedef Documentation

§ C◼F257

typedef _Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257

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

Function Documentation

§ C◼F257◼_Operator—add()

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

Operation in the ring ℤn.

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

References C◼F257◼_Operator—bnotbnot().

Referenced by C◼F257◼main(), and C◼F257◼order—257().

1475  {
1476 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1477  C◼F257 ret = a + b;
1478  return C◼F257◼_Operator—bnotbnot(ret);
1479 }
_Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257
Definition: C-F257.c:1446
C◼F257 C◼F257◼_Operator—bnotbnot(C◼F257 a)
Map a into ℤn.
Definition: C-F257.c:1470
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼_Operator—bnotbnot()

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

Map a into ℤn.

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

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

1470  {
1471 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1472  return a % _Intern◼_I584Rsma◼C◼F257◼Z—257◼mod₀;
1473 }
+ Here is the caller graph for this function:

§ C◼F257◼_Operator—div()

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

Operation in the ring ℤn.

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

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

1493  {
1494 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1495  C◼F257 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—257◼inverse(b);
1496  return C◼F257◼_Operator—bnotbnot(ret);
1497 }
_Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257
Definition: C-F257.c:1446
C◼F257 C◼F257◼_Operator—bnotbnot(C◼F257 a)
Map a into ℤn.
Definition: C-F257.c:1470
+ Here is the caller graph for this function:

§ C◼F257◼_Operator—eq()

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

Equality in the ring ℤn.

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

References C◼F257◼_Operator—bnotbnot().

Referenced by C◼F257◼main(), and C◼F257◼order—257().

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

§ C◼F257◼_Operator—mod()

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

Operation in the ring ℤn.

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

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

1499  {
1500 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1502 }
C◼F257 C◼F257◼_Operator—sub(C◼F257 a, C◼F257 b)
Operation in the ring ℤn.
Definition: C-F257.c:1481
C◼F257 C◼F257◼_Operator—div(C◼F257 a, C◼F257 b)
Operation in the ring ℤn.
Definition: C-F257.c:1493
C◼F257 C◼F257◼_Operator—prod(C◼F257 a, C◼F257 b)
Operation in the ring ℤn.
Definition: C-F257.c:1487
+ Here is the call graph for this function:

§ C◼F257◼_Operator—notnot()

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

Test if non-zero in ℤn.

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

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

1509  {
1510 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1511  return ‼C◼F257◼_Operator—bnotbnot(a);
1512 }
+ Here is the caller graph for this function:

§ C◼F257◼_Operator—prod()

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

Operation in the ring ℤn.

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

References C◼F257◼_Operator—bnotbnot().

Referenced by C◼F257◼_Operator—mod(), C◼F257◼main(), and C◼F257◼order—257().

1487  {
1488 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1489  C◼F257 ret = a * b;
1490  return C◼F257◼_Operator—bnotbnot(ret);
1491 }
_Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257
Definition: C-F257.c:1446
C◼F257 C◼F257◼_Operator—bnotbnot(C◼F257 a)
Map a into ℤn.
Definition: C-F257.c:1470
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼_Operator—sub()

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

Operation in the ring ℤn.

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

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

1481  {
1482 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1483  C◼F257 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—257◼mod₀ - b);
1484  return C◼F257◼_Operator—bnotbnot(ret);
1485 }
_Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257
Definition: C-F257.c:1446
C◼F257 C◼F257◼_Operator—bnotbnot(C◼F257 a)
Map a into ℤn.
Definition: C-F257.c:1470
+ Here is the caller graph for this function:

§ C◼F257◼order—257()

C◼F257 C◼F257◼order—257 ( C◼F257  x)

Compute the order of element .

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

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

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

1525  {
1526 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1527  if (¬(C◼F257◼_Operator—notnot(x ))) return 0;
1528  C◼F257 y = x;
1529  for (C◼F257 i = 1; i; ((i )=(C◼F257◼_Operator—add(i , 1)))) {
1530 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1531  if (C◼F257◼_Operator—eq(y , 1 )) return i;
1532  ((y )=(C◼F257◼_Operator—prod(y , x )));
1533  }
1534  // should not be reached
1535  return 0;
1536 }
_Intern◼_I584Rsma◼C◼F257◼Z—257◼type₀ C◼F257
Definition: C-F257.c:1446
C◼F257 C◼F257◼_Operator—add(C◼F257 a, C◼F257 b)
Operation in the ring ℤn.
Definition: C-F257.c:1475
C◼F257 C◼F257◼_Operator—prod(C◼F257 a, C◼F257 b)
Operation in the ring ℤn.
Definition: C-F257.c:1487
_Bool C◼F257◼_Operator—eq(C◼F257 a, C◼F257 b)
Equality in the ring ℤn.
Definition: C-F257.c:1504
C◼F257 C◼F257◼_Operator—notnot(C◼F257 a)
Test if non-zero in ℤn.
Definition: C-F257.c:1509
+ Here is the call graph for this function:

Variable Documentation

§ C◼F257◼generator—257

C◼F257 C◼F257◼generator—257 = C◼snippet◼modulo◼generator_default

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