add missing const qualifiers to arch variants of curve25519(), and to nxp_ltc_curve25519().

This commit is contained in:
Daniel Pouzzner
2020-08-05 21:12:50 -05:00
parent ffa2cdd2d1
commit 18178e056d
6 changed files with 6 additions and 6 deletions

View File

@@ -141,7 +141,7 @@ static void xc_diffadd(byte *x5, byte *z5,
}
#ifndef FREESCALE_LTC_ECC
int curve25519(byte *result, byte *e, byte *q)
int curve25519(byte *result, const byte *e, const byte *q)
{
/* Current point: P_m */
byte xm[F25519_SIZE];

View File

@@ -406,7 +406,7 @@ void fe_invert(fe r, const fe a)
* n The scalar as an array of bytes.
* a A field element as an array of bytes.
*/
int curve25519(byte* r, byte* n, byte* a)
int curve25519(byte* r, const byte* n, const byte* a)
{
fe x1, x2, z2, x3, z3;
fe t0, t1;

View File

@@ -2910,7 +2910,7 @@ void fe_invert(fe r, const fe a)
);
}
int curve25519(byte* r, byte* n, byte* a)
int curve25519(byte* r, const byte* n, const byte* a)
{
__asm__ __volatile__ (
"sub sp, sp, #0xbc\n\t"

View File

@@ -1007,7 +1007,7 @@ void fe_invert(fe r, const fe a)
);
}
int curve25519(byte* r, byte* n, byte* a)
int curve25519(byte* r, const byte* n, const byte* a)
{
__asm__ __volatile__ (
"stp x29, x30, [sp, #-192]!\n\t"

View File

@@ -1122,7 +1122,7 @@ status_t LTC_PKHA_Curve25519ComputeY(ltc_pkha_ecc_point_t *ltcPoint)
/* if type is set, the input point p is in Montgomery curve coordinates,
so there is a map to Weierstrass curve */
/* q output point is always in Montgomery curve coordinates */
int nxp_ltc_curve25519(ECPoint *q, byte *n, const ECPoint *p, fsl_ltc_ecc_coordinate_system_t type)
int nxp_ltc_curve25519(ECPoint *q, const byte *n, const ECPoint *p, fsl_ltc_ecc_coordinate_system_t type)
{
status_t status;
ltc_pkha_ecc_point_t ltcPoint;

View File

@@ -65,7 +65,7 @@ int ksdk_port_init(void);
int wc_ecc_point_add(ecc_point *mG, ecc_point *mQ, ecc_point *mR, mp_int *m);
#ifdef HAVE_CURVE25519
int nxp_ltc_curve25519(ECPoint *q, byte *n, const ECPoint *p, fsl_ltc_ecc_coordinate_system_t type);
int nxp_ltc_curve25519(ECPoint *q, const byte *n, const ECPoint *p, fsl_ltc_ecc_coordinate_system_t type);
const ECPoint *nxp_ltc_curve25519_GetBasePoint(void);
status_t LTC_PKHA_Curve25519ToWeierstrass(const ltc_pkha_ecc_point_t *ltcPointIn, ltc_pkha_ecc_point_t *ltcPointOut);
status_t LTC_PKHA_WeierstrassToCurve25519(const ltc_pkha_ecc_point_t *ltcPointIn, ltc_pkha_ecc_point_t *ltcPointOut);