"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ecc-mod-arith.c" between
nettle-3.7.1.tar.gz and nettle-3.7.2.tar.gz

About: Nettle is a low-level cryptographic library.

ecc-mod-arith.c  (nettle-3.7.1):ecc-mod-arith.c  (nettle-3.7.2)
skipping to change at line 129 skipping to change at line 129
void void
ecc_mod_sqr (const struct ecc_modulo *m, mp_limb_t *rp, ecc_mod_sqr (const struct ecc_modulo *m, mp_limb_t *rp,
const mp_limb_t *ap, mp_limb_t *tp) const mp_limb_t *ap, mp_limb_t *tp)
{ {
mpn_sqr (tp, ap, m->size); mpn_sqr (tp, ap, m->size);
m->reduce (m, rp, tp); m->reduce (m, rp, tp);
} }
void void
ecc_mod_mul_canonical (const struct ecc_modulo *m, mp_limb_t *rp,
const mp_limb_t *ap, const mp_limb_t *bp, mp_limb_t *tp)
{
mp_limb_t cy;
mpn_mul_n (tp, ap, bp, m->size);
m->reduce (m, tp + m->size, tp);
cy = mpn_sub_n (rp, tp + m->size, m->m, m->size);
cnd_copy (cy, rp, tp + m->size, m->size);
}
void
ecc_mod_sqr_canonical (const struct ecc_modulo *m, mp_limb_t *rp,
const mp_limb_t *ap, mp_limb_t *tp)
{
mp_limb_t cy;
mpn_sqr (tp, ap, m->size);
m->reduce (m, tp + m->size, tp);
cy = mpn_sub_n (rp, tp + m->size, m->m, m->size);
cnd_copy (cy, rp, tp + m->size, m->size);
}
void
ecc_mod_pow_2k (const struct ecc_modulo *m, ecc_mod_pow_2k (const struct ecc_modulo *m,
mp_limb_t *rp, const mp_limb_t *xp, mp_limb_t *rp, const mp_limb_t *xp,
unsigned k, mp_limb_t *tp) unsigned k, mp_limb_t *tp)
{ {
ecc_mod_sqr (m, rp, xp, tp); ecc_mod_sqr (m, rp, xp, tp);
while (--k > 0) while (--k > 0)
ecc_mod_sqr (m, rp, rp, tp); ecc_mod_sqr (m, rp, rp, tp);
} }
void void
 End of changes. 1 change blocks. 
0 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)