-/* $OpenBSD: bn_nist.c,v 1.20 2022/05/07 07:47:24 jsing Exp $ */
+/* $OpenBSD: bn_nist.c,v 1.21 2022/07/30 18:03:36 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
#endif
static const BIGNUM _bignum_nist_p_192 = {
- (BN_ULONG *)_nist_p_192[0],
- BN_NIST_192_TOP,
- BN_NIST_192_TOP,
- 0,
- BN_FLG_STATIC_DATA
+ .d = (BN_ULONG *)_nist_p_192[0],
+ .top = BN_NIST_192_TOP,
+ .dmax = BN_NIST_192_TOP,
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
+};
+
+static const BIGNUM _bignum_nist_p_192_sqr = {
+ .d = (BN_ULONG *)_nist_p_192_sqr,
+ .top = sizeof(_nist_p_192_sqr) / sizeof(_nist_p_192_sqr[0]),
+ .dmax = sizeof(_nist_p_192_sqr) / sizeof(_nist_p_192_sqr[0]),
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
};
static const BIGNUM _bignum_nist_p_224 = {
- (BN_ULONG *)_nist_p_224[0],
- BN_NIST_224_TOP,
- BN_NIST_224_TOP,
- 0,
- BN_FLG_STATIC_DATA
+ .d = (BN_ULONG *)_nist_p_224[0],
+ .top = BN_NIST_224_TOP,
+ .dmax = BN_NIST_224_TOP,
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
+};
+
+static const BIGNUM _bignum_nist_p_224_sqr = {
+ .d = (BN_ULONG *)_nist_p_224_sqr,
+ .top = sizeof(_nist_p_224_sqr) / sizeof(_nist_p_224_sqr[0]),
+ .dmax = sizeof(_nist_p_224_sqr) / sizeof(_nist_p_224_sqr[0]),
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
};
static const BIGNUM _bignum_nist_p_256 = {
- (BN_ULONG *)_nist_p_256[0],
- BN_NIST_256_TOP,
- BN_NIST_256_TOP,
- 0,
- BN_FLG_STATIC_DATA
+ .d = (BN_ULONG *)_nist_p_256[0],
+ .top = BN_NIST_256_TOP,
+ .dmax = BN_NIST_256_TOP,
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
+};
+
+static const BIGNUM _bignum_nist_p_256_sqr = {
+ .d = (BN_ULONG *)_nist_p_256_sqr,
+ .top = sizeof(_nist_p_256_sqr) / sizeof(_nist_p_256_sqr[0]),
+ .dmax = sizeof(_nist_p_256_sqr) / sizeof(_nist_p_256_sqr[0]),
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
};
static const BIGNUM _bignum_nist_p_384 = {
- (BN_ULONG *)_nist_p_384[0],
- BN_NIST_384_TOP,
- BN_NIST_384_TOP,
- 0,
- BN_FLG_STATIC_DATA
+ .d = (BN_ULONG *)_nist_p_384[0],
+ .top = BN_NIST_384_TOP,
+ .dmax = BN_NIST_384_TOP,
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
+};
+
+static const BIGNUM _bignum_nist_p_384_sqr = {
+ .d = (BN_ULONG *)_nist_p_384_sqr,
+ .top = sizeof(_nist_p_384_sqr) / sizeof(_nist_p_384_sqr[0]),
+ .dmax = sizeof(_nist_p_384_sqr) / sizeof(_nist_p_384_sqr[0]),
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
};
static const BIGNUM _bignum_nist_p_521 = {
- (BN_ULONG *)_nist_p_521,
- BN_NIST_521_TOP,
- BN_NIST_521_TOP,
- 0,
- BN_FLG_STATIC_DATA
+ .d = (BN_ULONG *)_nist_p_521,
+ .top = BN_NIST_521_TOP,
+ .dmax = BN_NIST_521_TOP,
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
};
+static const BIGNUM _bignum_nist_p_521_sqr = {
+ .d = (BN_ULONG *)_nist_p_521_sqr,
+ .top = sizeof(_nist_p_521_sqr) / sizeof(_nist_p_521_sqr[0]),
+ .dmax = sizeof(_nist_p_521_sqr) / sizeof(_nist_p_521_sqr[0]),
+ .neg = 0,
+ .flags = BN_FLG_STATIC_DATA,
+};
const BIGNUM *
BN_get0_nist_prime_192(void)
BN_ULONG bnbuf[BN_NIST_192_TOP] = { 0 };
BN_ULONG c_d[BN_NIST_192_TOP], *res;
uintptr_t mask;
- static const BIGNUM _bignum_nist_p_192_sqr = {
- (BN_ULONG *)_nist_p_192_sqr,
- sizeof(_nist_p_192_sqr) / sizeof(_nist_p_192_sqr[0]),
- sizeof(_nist_p_192_sqr) / sizeof(_nist_p_192_sqr[0]),
- 0,
- BN_FLG_STATIC_DATA
- };
field = &_bignum_nist_p_192; /* just to make sure */
BN_ULONG c_d[BN_NIST_224_TOP], *res;
uintptr_t mask;
bn_addsub_f addsubf;
- static const BIGNUM _bignum_nist_p_224_sqr = {
- (BN_ULONG *)_nist_p_224_sqr,
- sizeof(_nist_p_224_sqr) / sizeof(_nist_p_224_sqr[0]),
- sizeof(_nist_p_224_sqr) / sizeof(_nist_p_224_sqr[0]),
- 0,
- BN_FLG_STATIC_DATA
- };
field = &_bignum_nist_p_224; /* just to make sure */
BN_ULONG c_d[BN_NIST_256_TOP] = {0}, *res;
uintptr_t mask;
bn_addsub_f addsubf;
- static const BIGNUM _bignum_nist_p_256_sqr = {
- (BN_ULONG *)_nist_p_256_sqr,
- sizeof(_nist_p_256_sqr) / sizeof(_nist_p_256_sqr[0]),
- sizeof(_nist_p_256_sqr) / sizeof(_nist_p_256_sqr[0]),
- 0,
- BN_FLG_STATIC_DATA
- };
field = &_bignum_nist_p_256; /* just to make sure */
BN_ULONG c_d[BN_NIST_384_TOP], *res;
uintptr_t mask;
bn_addsub_f addsubf;
- static const BIGNUM _bignum_nist_p_384_sqr = {
- (BN_ULONG *)_nist_p_384_sqr,
- sizeof(_nist_p_384_sqr) / sizeof(_nist_p_384_sqr[0]),
- sizeof(_nist_p_384_sqr) / sizeof(_nist_p_384_sqr[0]),
- 0,
- BN_FLG_STATIC_DATA
- };
field = &_bignum_nist_p_384; /* just to make sure */
int top = a->top, i;
BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
uintptr_t mask;
- static const BIGNUM _bignum_nist_p_521_sqr = {
- (BN_ULONG *)_nist_p_521_sqr,
- sizeof(_nist_p_521_sqr) / sizeof(_nist_p_521_sqr[0]),
- sizeof(_nist_p_521_sqr) / sizeof(_nist_p_521_sqr[0]),
- 0,
- BN_FLG_STATIC_DATA
- };
field = &_bignum_nist_p_521; /* just to make sure */