mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-18 02:24:54 +00:00
Constify where possible.
This commit is contained in:
parent
cdd1a65e84
commit
895d1eb539
9 changed files with 17 additions and 17 deletions
|
@ -82,14 +82,14 @@ int mpi_load(cryb_mpi *, const uint8_t *, size_t);
|
|||
int mpi_set(cryb_mpi *, int32_t);
|
||||
int mpi_lshift(cryb_mpi *, unsigned int);
|
||||
int mpi_rshift(cryb_mpi *, unsigned int);
|
||||
int mpi_add_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
||||
int mpi_add(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
||||
int mpi_sub_abs(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
||||
int mpi_sub(cryb_mpi *, cryb_mpi *, cryb_mpi *);
|
||||
int mpi_cmp_abs(cryb_mpi *, cryb_mpi *);
|
||||
int mpi_cmp(cryb_mpi *, cryb_mpi *);
|
||||
int mpi_eq_abs(cryb_mpi *, cryb_mpi *);
|
||||
int mpi_eq(cryb_mpi *, cryb_mpi *);
|
||||
int mpi_add_abs(cryb_mpi *, const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_add(cryb_mpi *, const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_sub_abs(cryb_mpi *, const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_sub(cryb_mpi *, const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_cmp_abs(const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_cmp(const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_eq_abs(const cryb_mpi *, const cryb_mpi *);
|
||||
int mpi_eq(const cryb_mpi *, const cryb_mpi *);
|
||||
|
||||
CRYB_END
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* Add two numbers together.
|
||||
*/
|
||||
int
|
||||
mpi_add(cryb_mpi *X, cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_add(cryb_mpi *X, const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
|
||||
if (A->neg && B->neg) {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* Store the sum of the absolutes values of A and B in X.
|
||||
*/
|
||||
int
|
||||
mpi_add_abs(cryb_mpi *X, cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_add_abs(cryb_mpi *X, const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t c;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Compare signed values
|
||||
*/
|
||||
int
|
||||
mpi_cmp(cryb_mpi *X, cryb_mpi *Y)
|
||||
mpi_cmp(const cryb_mpi *X, const cryb_mpi *Y)
|
||||
{
|
||||
|
||||
if (X->neg) {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Compare absolute values
|
||||
*/
|
||||
int
|
||||
mpi_cmp_abs(cryb_mpi *X, cryb_mpi *Y)
|
||||
mpi_cmp_abs(const cryb_mpi *X, const cryb_mpi *Y)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Compare signed values for equality
|
||||
*/
|
||||
int
|
||||
mpi_eq(cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_eq(const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
|
||||
return (A->neg == B->neg && A->msb == B->msb &&
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Compare absolute values for equality
|
||||
*/
|
||||
int
|
||||
mpi_eq_abs(cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_eq_abs(const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
|
||||
return (A->msb == B->msb &&
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* Subtract one number from another.
|
||||
*/
|
||||
int
|
||||
mpi_sub(cryb_mpi *X, cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_sub(cryb_mpi *X, const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
|
||||
if (A->neg && B->neg) {
|
||||
|
|
|
@ -40,9 +40,9 @@
|
|||
* Store the difference between the absolute values of A and B in X.
|
||||
*/
|
||||
int
|
||||
mpi_sub_abs(cryb_mpi *X, cryb_mpi *A, cryb_mpi *B)
|
||||
mpi_sub_abs(cryb_mpi *X, const cryb_mpi *A, const cryb_mpi *B)
|
||||
{
|
||||
cryb_mpi *L, *G;
|
||||
const cryb_mpi *L, *G;
|
||||
unsigned int i;
|
||||
uint32_t c, cn;
|
||||
|
||||
|
|
Loading…
Reference in a new issue