security/nss/lib/freebl/mpi/mpi_amd64.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/mpi/mpi_amd64.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,32 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef MPI_AMD64
     1.9 +#error This file only works on AMD64 platforms.
    1.10 +#endif
    1.11 +
    1.12 +#include <mpi-priv.h>
    1.13 +
    1.14 +/*
    1.15 + * MPI glue
    1.16 + *
    1.17 + */
    1.18 +
    1.19 +/* Presently, this is only used by the Montgomery arithmetic code. */
    1.20 +/* c += a * b */
    1.21 +void MPI_ASM_DECL s_mpv_mul_d_add_prop(const mp_digit *a, mp_size a_len,
    1.22 +                                       mp_digit b, mp_digit *c)
    1.23 +{
    1.24 +  mp_digit w;
    1.25 +  mp_digit d;
    1.26 +
    1.27 +  d = s_mpv_mul_add_vec64(c, a, a_len, b);
    1.28 +  c += a_len;
    1.29 +  while (d) {
    1.30 +    w = c[0] + d;
    1.31 +    d = (w < c[0] || w < d);
    1.32 +    *c++ = w;
    1.33 +  }
    1.34 +}
    1.35 +

mercurial