|
@@ -9537,7 +9537,7 @@ it hasn't proven hard to write \textit{glue} to use math libraries so far. The
|
|
/** math descriptor */
|
|
/** math descriptor */
|
|
typedef struct {
|
|
typedef struct {
|
|
/** Name of the math provider */
|
|
/** Name of the math provider */
|
|
- char *name;
|
|
|
|
|
|
+ const char *name;
|
|
|
|
|
|
/** Bits per digit, amount of bits must fit in an unsigned long */
|
|
/** Bits per digit, amount of bits must fit in an unsigned long */
|
|
int bits_per_digit;
|
|
int bits_per_digit;
|
|
@@ -9555,7 +9555,7 @@ typedef struct {
|
|
@param src The number to copy from
|
|
@param src The number to copy from
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*init_copy)(void **dst, void *src);
|
|
|
|
|
|
+ int (*init_copy)(void **dst, const void *src);
|
|
|
|
|
|
/** deinit
|
|
/** deinit
|
|
@param a The number to free
|
|
@param a The number to free
|
|
@@ -9570,14 +9570,14 @@ typedef struct {
|
|
@param dst The destination
|
|
@param dst The destination
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*neg)(void *src, void *dst);
|
|
|
|
|
|
+ int (*neg)(const void *src, void *dst);
|
|
|
|
|
|
/** copy
|
|
/** copy
|
|
@param src The number to copy from
|
|
@param src The number to copy from
|
|
@param dst The number to write to
|
|
@param dst The number to write to
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*copy)(void *src, void *dst);
|
|
|
|
|
|
+ int (*copy)(const void *src, void *dst);
|
|
|
|
|
|
/* ---- trivial low level functions ---- */
|
|
/* ---- trivial low level functions ---- */
|
|
|
|
|
|
@@ -9593,20 +9593,20 @@ typedef struct {
|
|
only fetches up to bits_per_digit from the number
|
|
only fetches up to bits_per_digit from the number
|
|
@return The lower bits_per_digit of the integer (unsigned)
|
|
@return The lower bits_per_digit of the integer (unsigned)
|
|
*/
|
|
*/
|
|
- unsigned long (*get_int)(void *a);
|
|
|
|
|
|
+ unsigned long (*get_int)(const void *a);
|
|
|
|
|
|
/** get digit n
|
|
/** get digit n
|
|
@param a The number to read from
|
|
@param a The number to read from
|
|
@param n The number of the digit to fetch
|
|
@param n The number of the digit to fetch
|
|
@return The bits_per_digit sized n'th digit of a
|
|
@return The bits_per_digit sized n'th digit of a
|
|
*/
|
|
*/
|
|
- ltc_mp_digit (*get_digit)(void *a, int n);
|
|
|
|
|
|
+ ltc_mp_digit (*get_digit)(const void *a, int n);
|
|
|
|
|
|
/** Get the number of digits that represent the number
|
|
/** Get the number of digits that represent the number
|
|
@param a The number to count
|
|
@param a The number to count
|
|
@return The number of digits used to represent the number
|
|
@return The number of digits used to represent the number
|
|
*/
|
|
*/
|
|
- int (*get_digit_count)(void *a);
|
|
|
|
|
|
+ int (*get_digit_count)(const void *a);
|
|
|
|
|
|
/** compare two integers
|
|
/** compare two integers
|
|
@param a The left side integer
|
|
@param a The left side integer
|
|
@@ -9615,7 +9615,7 @@ typedef struct {
|
|
LTC_MP_GT if a > b and
|
|
LTC_MP_GT if a > b and
|
|
LTC_MP_EQ otherwise. (signed comparison)
|
|
LTC_MP_EQ otherwise. (signed comparison)
|
|
*/
|
|
*/
|
|
- int (*compare)(void *a, void *b);
|
|
|
|
|
|
+ int (*compare)(const void *a, const void *b);
|
|
|
|
|
|
/** compare against int
|
|
/** compare against int
|
|
@param a The left side integer
|
|
@param a The left side integer
|
|
@@ -9624,19 +9624,19 @@ typedef struct {
|
|
LTC_MP_GT if a > b and
|
|
LTC_MP_GT if a > b and
|
|
LTC_MP_EQ otherwise. (signed comparison)
|
|
LTC_MP_EQ otherwise. (signed comparison)
|
|
*/
|
|
*/
|
|
- int (*compare_d)(void *a, unsigned long n);
|
|
|
|
|
|
+ int (*compare_d)(const void *a, unsigned long n);
|
|
|
|
|
|
/** Count the number of bits used to represent the integer
|
|
/** Count the number of bits used to represent the integer
|
|
@param a The integer to count
|
|
@param a The integer to count
|
|
@return The number of bits required to represent the integer
|
|
@return The number of bits required to represent the integer
|
|
*/
|
|
*/
|
|
- int (*count_bits)(void * a);
|
|
|
|
|
|
+ int (*count_bits)(const void * a);
|
|
|
|
|
|
/** Count the number of LSB bits which are zero
|
|
/** Count the number of LSB bits which are zero
|
|
@param a The integer to count
|
|
@param a The integer to count
|
|
@return The number of contiguous zero LSB bits
|
|
@return The number of contiguous zero LSB bits
|
|
*/
|
|
*/
|
|
- int (*count_lsb_bits)(void *a);
|
|
|
|
|
|
+ int (*count_lsb_bits)(const void *a);
|
|
|
|
|
|
/** Compute a power of two
|
|
/** Compute a power of two
|
|
@param a The integer to store the power in
|
|
@param a The integer to store the power in
|
|
@@ -9661,20 +9661,20 @@ typedef struct {
|
|
@param radix The radix the integer is to be represented in (2-64)
|
|
@param radix The radix the integer is to be represented in (2-64)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*write_radix)(void *a, char *str, int radix);
|
|
|
|
|
|
+ int (*write_radix)(const void *a, char *str, int radix);
|
|
|
|
|
|
/** get size as unsigned char string
|
|
/** get size as unsigned char string
|
|
@param a The integer to get the size (when stored in array of octets)
|
|
@param a The integer to get the size (when stored in array of octets)
|
|
@return The length of the integer in octets
|
|
@return The length of the integer in octets
|
|
*/
|
|
*/
|
|
- unsigned long (*unsigned_size)(void *a);
|
|
|
|
|
|
+ unsigned long (*unsigned_size)(const void *a);
|
|
|
|
|
|
/** store an integer as an array of octets
|
|
/** store an integer as an array of octets
|
|
@param src The integer to store
|
|
@param src The integer to store
|
|
@param dst The buffer to store the integer in
|
|
@param dst The buffer to store the integer in
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*unsigned_write)(void *src, unsigned char *dst);
|
|
|
|
|
|
+ int (*unsigned_write)(const void *src, unsigned char *dst);
|
|
|
|
|
|
/** read an array of octets and store as integer
|
|
/** read an array of octets and store as integer
|
|
@param dst The integer to load
|
|
@param dst The integer to load
|
|
@@ -9682,9 +9682,9 @@ typedef struct {
|
|
@param len The number of octets
|
|
@param len The number of octets
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*unsigned_read)( void *dst,
|
|
|
|
- unsigned char *src,
|
|
|
|
- unsigned long len);
|
|
|
|
|
|
+ int (*unsigned_read)( void *dst,
|
|
|
|
+ const unsigned char *src,
|
|
|
|
+ unsigned long len);
|
|
|
|
|
|
/* ---- basic math ---- */
|
|
/* ---- basic math ---- */
|
|
|
|
|
|
@@ -9694,7 +9694,7 @@ typedef struct {
|
|
@param c The destination of "a + b"
|
|
@param c The destination of "a + b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*add)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*add)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** add two integers
|
|
/** add two integers
|
|
@param a The first source integer
|
|
@param a The first source integer
|
|
@@ -9703,7 +9703,7 @@ typedef struct {
|
|
@param c The destination of "a + b"
|
|
@param c The destination of "a + b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*addi)(void *a, unsigned long b, void *c);
|
|
|
|
|
|
+ int (*addi)(const void *a, unsigned long b, void *c);
|
|
|
|
|
|
/** subtract two integers
|
|
/** subtract two integers
|
|
@param a The first source integer
|
|
@param a The first source integer
|
|
@@ -9711,7 +9711,7 @@ typedef struct {
|
|
@param c The destination of "a - b"
|
|
@param c The destination of "a - b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*sub)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*sub)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** subtract two integers
|
|
/** subtract two integers
|
|
@param a The first source integer
|
|
@param a The first source integer
|
|
@@ -9720,7 +9720,7 @@ typedef struct {
|
|
@param c The destination of "a - b"
|
|
@param c The destination of "a - b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*subi)(void *a, unsigned long b, void *c);
|
|
|
|
|
|
+ int (*subi)(const void *a, unsigned long b, void *c);
|
|
|
|
|
|
/** multiply two integers
|
|
/** multiply two integers
|
|
@param a The first source integer
|
|
@param a The first source integer
|
|
@@ -9729,7 +9729,7 @@ typedef struct {
|
|
@param c The destination of "a * b"
|
|
@param c The destination of "a * b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*mul)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*mul)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** multiply two integers
|
|
/** multiply two integers
|
|
@param a The first source integer
|
|
@param a The first source integer
|
|
@@ -9738,14 +9738,14 @@ typedef struct {
|
|
@param c The destination of "a * b"
|
|
@param c The destination of "a * b"
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*muli)(void *a, unsigned long b, void *c);
|
|
|
|
|
|
+ int (*muli)(const void *a, unsigned long b, void *c);
|
|
|
|
|
|
/** Square an integer
|
|
/** Square an integer
|
|
@param a The integer to square
|
|
@param a The integer to square
|
|
@param b The destination
|
|
@param b The destination
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*sqr)(void *a, void *b);
|
|
|
|
|
|
+ int (*sqr)(const void *a, void *b);
|
|
|
|
|
|
/** Divide an integer
|
|
/** Divide an integer
|
|
@param a The dividend
|
|
@param a The dividend
|
|
@@ -9754,14 +9754,14 @@ typedef struct {
|
|
@param d The remainder (can be NULL to signify don't care)
|
|
@param d The remainder (can be NULL to signify don't care)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*mpdiv)(void *a, void *b, void *c, void *d);
|
|
|
|
|
|
+ int (*mpdiv)(const void *a, const void *b, void *c, void *d);
|
|
|
|
|
|
/** divide by two
|
|
/** divide by two
|
|
@param a The integer to divide (shift right)
|
|
@param a The integer to divide (shift right)
|
|
@param b The destination
|
|
@param b The destination
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*div_2)(void *a, void *b);
|
|
|
|
|
|
+ int (*div_2)(const void *a, void *b);
|
|
|
|
|
|
/** Get remainder (small value)
|
|
/** Get remainder (small value)
|
|
@param a The integer to reduce
|
|
@param a The integer to reduce
|
|
@@ -9769,7 +9769,7 @@ typedef struct {
|
|
@param c The destination for the residue
|
|
@param c The destination for the residue
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*modi)(void *a, unsigned long b, unsigned long *c);
|
|
|
|
|
|
+ int (*modi)(const void *a, unsigned long b, unsigned long *c);
|
|
|
|
|
|
/** gcd
|
|
/** gcd
|
|
@param a The first integer
|
|
@param a The first integer
|
|
@@ -9777,7 +9777,7 @@ typedef struct {
|
|
@param c The destination for (a, b)
|
|
@param c The destination for (a, b)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*gcd)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*gcd)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** lcm
|
|
/** lcm
|
|
@param a The first integer
|
|
@param a The first integer
|
|
@@ -9785,7 +9785,7 @@ typedef struct {
|
|
@param c The destination for [a, b]
|
|
@param c The destination for [a, b]
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*lcm)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*lcm)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** Modular multiplication
|
|
/** Modular multiplication
|
|
@param a The first source
|
|
@param a The first source
|
|
@@ -9794,7 +9794,7 @@ typedef struct {
|
|
@param d The destination (a*b mod c)
|
|
@param d The destination (a*b mod c)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*mulmod)(void *a, void *b, void *c, void *d);
|
|
|
|
|
|
+ int (*mulmod)(const void *a, const void *b, const void *c, void *d);
|
|
|
|
|
|
/** Modular squaring
|
|
/** Modular squaring
|
|
@param a The first source
|
|
@param a The first source
|
|
@@ -9802,7 +9802,7 @@ typedef struct {
|
|
@param c The destination (a*a mod b)
|
|
@param c The destination (a*a mod b)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*sqrmod)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*sqrmod)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/** Modular inversion
|
|
/** Modular inversion
|
|
@param a The value to invert
|
|
@param a The value to invert
|
|
@@ -9810,7 +9810,7 @@ typedef struct {
|
|
@param c The destination (1/a mod b)
|
|
@param c The destination (1/a mod b)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*invmod)(void *, void *, void *);
|
|
|
|
|
|
+ int (*invmod)(const void *a, const void *b, void *c);
|
|
|
|
|
|
/* ---- reduction ---- */
|
|
/* ---- reduction ---- */
|
|
|
|
|
|
@@ -9819,14 +9819,14 @@ typedef struct {
|
|
@param b The destination for the reduction digit
|
|
@param b The destination for the reduction digit
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*montgomery_setup)(void *a, void **b);
|
|
|
|
|
|
+ int (*montgomery_setup)(const void *a, void **b);
|
|
|
|
|
|
/** get normalization value
|
|
/** get normalization value
|
|
@param a The destination for the normalization value
|
|
@param a The destination for the normalization value
|
|
@param b The modulus
|
|
@param b The modulus
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*montgomery_normalization)(void *a, void *b);
|
|
|
|
|
|
+ int (*montgomery_normalization)(void *a, const void *b);
|
|
|
|
|
|
/** reduce a number
|
|
/** reduce a number
|
|
@param a The number [and dest] to reduce
|
|
@param a The number [and dest] to reduce
|
|
@@ -9834,7 +9834,7 @@ typedef struct {
|
|
@param c The value "b" from montgomery_setup()
|
|
@param c The value "b" from montgomery_setup()
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*montgomery_reduce)(void *a, void *b, void *c);
|
|
|
|
|
|
+ int (*montgomery_reduce)(void *a, const void *b, void *c);
|
|
|
|
|
|
/** clean up (frees memory)
|
|
/** clean up (frees memory)
|
|
@param a The value "b" from montgomery_setup()
|
|
@param a The value "b" from montgomery_setup()
|
|
@@ -9851,7 +9851,7 @@ typedef struct {
|
|
@param d The destination
|
|
@param d The destination
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*exptmod)(void *a, void *b, void *c, void *d);
|
|
|
|
|
|
+ int (*exptmod)(const void *a, const void *b, const void *c, void *d);
|
|
|
|
|
|
/** Primality testing
|
|
/** Primality testing
|
|
@param a The integer to test
|
|
@param a The integer to test
|
|
@@ -9859,7 +9859,7 @@ typedef struct {
|
|
@param c The destination of the result (FP_YES if prime)
|
|
@param c The destination of the result (FP_YES if prime)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*isprime)(void *a, int b, int *c);
|
|
|
|
|
|
+ int (*isprime)(const void *a, int b, int *c);
|
|
|
|
|
|
/* ---- (optional) ecc point math ---- */
|
|
/* ---- (optional) ecc point math ---- */
|
|
|
|
|
|
@@ -9867,42 +9867,48 @@ typedef struct {
|
|
@param k The integer to multiply the point by
|
|
@param k The integer to multiply the point by
|
|
@param G The point to multiply
|
|
@param G The point to multiply
|
|
@param R The destination for kG
|
|
@param R The destination for kG
|
|
|
|
+ @param a ECC curve parameter a
|
|
@param modulus The modulus for the field
|
|
@param modulus The modulus for the field
|
|
@param map Boolean indicated whether to map back to affine or not
|
|
@param map Boolean indicated whether to map back to affine or not
|
|
(can be ignored if you work in affine only)
|
|
(can be ignored if you work in affine only)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*ecc_ptmul)( void *k,
|
|
|
|
- ecc_point *G,
|
|
|
|
- ecc_point *R,
|
|
|
|
- void *modulus,
|
|
|
|
|
|
+ int (*ecc_ptmul)( const void *k,
|
|
|
|
+ const ecc_point *G,
|
|
|
|
+ ecc_point *R,
|
|
|
|
+ const void *a,
|
|
|
|
+ const void *modulus,
|
|
int map);
|
|
int map);
|
|
|
|
|
|
/** ECC GF(p) point addition
|
|
/** ECC GF(p) point addition
|
|
@param P The first point
|
|
@param P The first point
|
|
@param Q The second point
|
|
@param Q The second point
|
|
@param R The destination of P + Q
|
|
@param R The destination of P + Q
|
|
|
|
+ @param ma The curve parameter "a" in montgomery form
|
|
@param modulus The modulus
|
|
@param modulus The modulus
|
|
@param mp The "b" value from montgomery_setup()
|
|
@param mp The "b" value from montgomery_setup()
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*ecc_ptadd)(ecc_point *P,
|
|
|
|
- ecc_point *Q,
|
|
|
|
- ecc_point *R,
|
|
|
|
- void *modulus,
|
|
|
|
- void *mp);
|
|
|
|
|
|
+ int (*ecc_ptadd)(const ecc_point *P,
|
|
|
|
+ const ecc_point *Q,
|
|
|
|
+ ecc_point *R,
|
|
|
|
+ const void *ma,
|
|
|
|
+ const void *modulus,
|
|
|
|
+ void *mp);
|
|
|
|
|
|
/** ECC GF(p) point double
|
|
/** ECC GF(p) point double
|
|
@param P The first point
|
|
@param P The first point
|
|
@param R The destination of 2P
|
|
@param R The destination of 2P
|
|
|
|
+ @param ma The curve parameter "a" in montgomery form
|
|
@param modulus The modulus
|
|
@param modulus The modulus
|
|
@param mp The "b" value from montgomery_setup()
|
|
@param mp The "b" value from montgomery_setup()
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*ecc_ptdbl)(ecc_point *P,
|
|
|
|
- ecc_point *R,
|
|
|
|
- void *modulus,
|
|
|
|
- void *mp);
|
|
|
|
|
|
+ int (*ecc_ptdbl)(const ecc_point *P,
|
|
|
|
+ ecc_point *R,
|
|
|
|
+ const void *ma,
|
|
|
|
+ const void *modulus,
|
|
|
|
+ void *mp);
|
|
|
|
|
|
/** ECC mapping from projective to affine,
|
|
/** ECC mapping from projective to affine,
|
|
currently uses (x,y,z) => (x/z^2, y/z^3, 1)
|
|
currently uses (x,y,z) => (x/z^2, y/z^3, 1)
|
|
@@ -9914,7 +9920,7 @@ typedef struct {
|
|
ecc_point only has three integers (x,y,z) so if
|
|
ecc_point only has three integers (x,y,z) so if
|
|
you use a different mapping you have to make it fit.
|
|
you use a different mapping you have to make it fit.
|
|
*/
|
|
*/
|
|
- int (*ecc_map)(ecc_point *P, void *modulus, void *mp);
|
|
|
|
|
|
+ int (*ecc_map)(ecc_point *P, const void *modulus, void *mp);
|
|
|
|
|
|
/** Computes kA*A + kB*B = C using Shamir's Trick
|
|
/** Computes kA*A + kB*B = C using Shamir's Trick
|
|
@param A First point to multiply
|
|
@param A First point to multiply
|
|
@@ -9925,10 +9931,10 @@ typedef struct {
|
|
@param modulus Modulus for curve
|
|
@param modulus Modulus for curve
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*ecc_mul2add)(ecc_point *A, void *kA,
|
|
|
|
- ecc_point *B, void *kB,
|
|
|
|
- ecc_point *C,
|
|
|
|
- void *modulus);
|
|
|
|
|
|
+ int (*ecc_mul2add)(const ecc_point *A, void *kA,
|
|
|
|
+ const ecc_point *B, void *kB,
|
|
|
|
+ ecc_point *C,
|
|
|
|
+ const void *modulus);
|
|
|
|
|
|
/* ---- (optional) rsa optimized math (for internal CRT) ---- */
|
|
/* ---- (optional) rsa optimized math (for internal CRT) ---- */
|
|
|
|
|
|
@@ -9959,7 +9965,7 @@ typedef struct {
|
|
*/
|
|
*/
|
|
int (*rsa_me)(const unsigned char *in, unsigned long inlen,
|
|
int (*rsa_me)(const unsigned char *in, unsigned long inlen,
|
|
unsigned char *out, unsigned long *outlen, int which,
|
|
unsigned char *out, unsigned long *outlen, int which,
|
|
- rsa_key *key);
|
|
|
|
|
|
+ const rsa_key *key);
|
|
|
|
|
|
/* ---- basic math continued ---- */
|
|
/* ---- basic math continued ---- */
|
|
|
|
|
|
@@ -9970,7 +9976,7 @@ typedef struct {
|
|
@param d The destination (a + b mod c)
|
|
@param d The destination (a + b mod c)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*addmod)(void *a, void *b, void *c, void *d);
|
|
|
|
|
|
+ int (*addmod)(const void *a, const void *b, const void *c, void *d);
|
|
|
|
|
|
/** Modular substraction
|
|
/** Modular substraction
|
|
@param a The first source
|
|
@param a The first source
|
|
@@ -9979,7 +9985,7 @@ typedef struct {
|
|
@param d The destination (a - b mod c)
|
|
@param d The destination (a - b mod c)
|
|
@return CRYPT_OK on success
|
|
@return CRYPT_OK on success
|
|
*/
|
|
*/
|
|
- int (*submod)(void *a, void *b, void *c, void *d);
|
|
|
|
|
|
+ int (*submod)(const void *a, const void *b, const void *c, void *d);
|
|
|
|
|
|
/* ---- misc stuff ---- */
|
|
/* ---- misc stuff ---- */
|
|
|
|
|