blob: c86fdc80743542626724ae73675b80c7766ca6f2 [file] [log] [blame]
/* Copyright (c) 2014, Intel Corporation.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef OPENSSL_HEADER_EC_ECP_NISTZ256_H
#define OPENSSL_HEADER_EC_ECP_NISTZ256_H
#include "../../limbs/limbs.h"
#define P256_LIMBS (256u / LIMB_BITS)
typedef struct {
Limb X[P256_LIMBS];
Limb Y[P256_LIMBS];
Limb Z[P256_LIMBS];
} P256_POINT;
typedef struct {
Limb X[P256_LIMBS];
Limb Y[P256_LIMBS];
} P256_POINT_AFFINE;
void GFp_nistz256_mul_mont(Limb res[P256_LIMBS], const Limb a[P256_LIMBS],
const Limb b[P256_LIMBS]);
void GFp_nistz256_sqr_mont(Limb res[P256_LIMBS], const Limb a[P256_LIMBS]);
/* Functions that perform constant time access to the precomputed tables */
void GFp_nistz256_select_w5(P256_POINT *out, const P256_POINT table[16],
int index);
void GFp_nistz256_select_w7(P256_POINT_AFFINE *out,
const P256_POINT_AFFINE table[64], int index);
#endif /* OPENSSL_HEADER_EC_ECP_NISTZ256_H */