-/* $OpenBSD: ec2_oct.c,v 1.16 2021/05/03 14:42:45 tb Exp $ */
+/* $OpenBSD: ec2_oct.c,v 1.17 2022/11/19 07:00:57 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
* the same method, but claim no priority date earlier than July 29, 1994
* (and additionally fail to cite the EUROCRYPT '92 publication as prior art).
*/
-int
+int
ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
const BIGNUM *x_, int y_bit, BN_CTX *ctx)
{
* If buf is NULL, the encoded length will be returned.
* If the length len of buf is smaller than required an error will be returned.
*/
-size_t
+size_t
ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
point_conversion_form_t form,
unsigned char *buf, size_t len, BN_CTX * ctx)
-/* $OpenBSD: ec2_smpl.c,v 1.23 2021/09/08 17:29:21 tb Exp $ */
+/* $OpenBSD: ec2_smpl.c,v 1.24 2022/11/19 07:00:57 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
/* Initialize a GF(2^m)-based EC_GROUP structure.
* Note that all other members are handled by EC_GROUP_new.
*/
-int
+int
ec_GF2m_simple_group_init(EC_GROUP * group)
{
BN_init(&group->field);
/* Free a GF(2^m)-based EC_GROUP structure.
* Note that all other members are handled by EC_GROUP_free.
*/
-void
+void
ec_GF2m_simple_group_finish(EC_GROUP * group)
{
BN_free(&group->field);
/* Clear and free a GF(2^m)-based EC_GROUP structure.
* Note that all other members are handled by EC_GROUP_clear_free.
*/
-void
+void
ec_GF2m_simple_group_clear_finish(EC_GROUP * group)
{
BN_clear_free(&group->field);
/* Copy a GF(2^m)-based EC_GROUP structure.
* Note that all other members are handled by EC_GROUP_copy.
*/
-int
+int
ec_GF2m_simple_group_copy(EC_GROUP * dest, const EC_GROUP * src)
{
int i;
/* Set the curve parameters of an EC_GROUP structure. */
-int
+int
ec_GF2m_simple_group_set_curve(EC_GROUP * group,
const BIGNUM * p, const BIGNUM * a, const BIGNUM * b, BN_CTX * ctx)
{
/* Get the curve parameters of an EC_GROUP structure.
* If p, a, or b are NULL then there values will not be set but the method will return with success.
*/
-int
+int
ec_GF2m_simple_group_get_curve(const EC_GROUP *group,
BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
{
/* Gets the degree of the field. For a curve over GF(2^m) this is the value m. */
-int
+int
ec_GF2m_simple_group_get_degree(const EC_GROUP * group)
{
return BN_num_bits(&group->field) - 1;
/* Checks the discriminant of the curve.
* y^2 + x*y = x^3 + a*x^2 + b is an elliptic curve <=> b != 0 (mod p)
*/
-int
+int
ec_GF2m_simple_group_check_discriminant(const EC_GROUP * group, BN_CTX * ctx)
{
int ret = 0;
/* Initializes an EC_POINT. */
-int
+int
ec_GF2m_simple_point_init(EC_POINT * point)
{
BN_init(&point->X);
/* Frees an EC_POINT. */
-void
+void
ec_GF2m_simple_point_finish(EC_POINT * point)
{
BN_free(&point->X);
/* Clears and frees an EC_POINT. */
-void
+void
ec_GF2m_simple_point_clear_finish(EC_POINT * point)
{
BN_clear_free(&point->X);
/* Copy the contents of one EC_POINT into another. Assumes dest is initialized. */
-int
+int
ec_GF2m_simple_point_copy(EC_POINT * dest, const EC_POINT * src)
{
if (!BN_copy(&dest->X, &src->X))
/* Set an EC_POINT to the point at infinity.
* A point at infinity is represented by having Z=0.
*/
-int
+int
ec_GF2m_simple_point_set_to_infinity(const EC_GROUP * group, EC_POINT * point)
{
point->Z_is_one = 0;
/* Set the coordinates of an EC_POINT using affine coordinates.
* Note that the simple implementation only uses affine coordinates.
*/
-int
+int
ec_GF2m_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point,
const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx)
{
/* Gets the affine coordinates of an EC_POINT.
* Note that the simple implementation only uses affine coordinates.
*/
-int
+int
ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
{
/* Computes a + b and stores the result in r. r could be a or b, a could be b.
* Uses algorithm A.10.2 of IEEE P1363.
*/
-int
+int
ec_GF2m_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx)
{
/* Computes 2 * a and stores the result in r. r could be a.
* Uses algorithm A.10.2 of IEEE P1363.
*/
-int
+int
ec_GF2m_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
BN_CTX *ctx)
{
return ec_GF2m_simple_add(group, r, a, a, ctx);
}
-int
+int
ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
{
if (EC_POINT_is_at_infinity(group, point) > 0 || BN_is_zero(&point->Y))
/* Indicates whether the given point is the point at infinity. */
-int
+int
ec_GF2m_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
{
return BN_is_zero(&point->Z);
* in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation:
* y^2 + x*y = x^3 + a*x^2 + b.
*/
-int
+int
ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
{
int ret = -1;
* 0 equal (in affine coordinates)
* 1 not equal
*/
-int
+int
ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx)
{
/* Forces the given EC_POINT to internally use affine coordinates. */
-int
+int
ec_GF2m_simple_make_affine(const EC_GROUP * group, EC_POINT * point, BN_CTX * ctx)
{
BN_CTX *new_ctx = NULL;
/* Forces each of the EC_POINTs in the given array to use affine coordinates. */
-int
+int
ec_GF2m_simple_points_make_affine(const EC_GROUP *group, size_t num,
EC_POINT *points[], BN_CTX *ctx)
{
/* Wrapper to simple binary polynomial field multiplication implementation. */
-int
+int
ec_GF2m_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
const BIGNUM *b, BN_CTX *ctx)
{
/* Wrapper to simple binary polynomial field squaring implementation. */
-int
+int
ec_GF2m_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
BN_CTX *ctx)
{
/* Wrapper to simple binary polynomial field division implementation. */
-int
+int
ec_GF2m_simple_field_div(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
const BIGNUM *b, BN_CTX *ctx)
{
-/* $OpenBSD: ec_ameth.c,v 1.33 2022/06/27 12:36:05 tb Exp $ */
+/* $OpenBSD: ec_ameth.c,v 1.34 2022/11/19 07:00:57 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
static int ecdh_cms_encrypt(CMS_RecipientInfo *ri);
#endif
-static int
+static int
eckey_param2type(int *pptype, void **ppval, EC_KEY * ec_key)
{
const EC_GROUP *group;
return 1;
}
-static int
+static int
eckey_pub_encode(X509_PUBKEY * pk, const EVP_PKEY * pkey)
{
EC_KEY *ec_key = pkey->pkey.ec;
return NULL;
}
-static int
+static int
eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey)
{
const unsigned char *p = NULL;
return 0;
}
-static int
+static int
eckey_pub_cmp(const EVP_PKEY * a, const EVP_PKEY * b)
{
int r;
return -2;
}
-static int
+static int
eckey_priv_decode(EVP_PKEY * pkey, const PKCS8_PRIV_KEY_INFO * p8)
{
const unsigned char *p = NULL;
return 0;
}
-static int
+static int
eckey_priv_encode(PKCS8_PRIV_KEY_INFO * p8, const EVP_PKEY * pkey)
{
EC_KEY *ec_key;
return 1;
}
-static int
+static int
int_ec_size(const EVP_PKEY * pkey)
{
return ECDSA_size(pkey->pkey.ec);
}
-static int
+static int
ec_bits(const EVP_PKEY * pkey)
{
BIGNUM *order = BN_new();
return ecbits / 2;
}
-static int
+static int
ec_missing_parameters(const EVP_PKEY * pkey)
{
if (EC_KEY_get0_group(pkey->pkey.ec) == NULL)
return 0;
}
-static int
+static int
ec_copy_parameters(EVP_PKEY * to, const EVP_PKEY * from)
{
return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec));
}
-static int
+static int
ec_cmp_parameters(const EVP_PKEY * a, const EVP_PKEY * b)
{
const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), *group_b = EC_KEY_get0_group(b->pkey.ec);
return 1;
}
-static void
+static void
int_ec_free(EVP_PKEY * pkey)
{
EC_KEY_free(pkey->pkey.ec);
}
-static int
+static int
do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype)
{
unsigned char *buffer = NULL;
return (ret);
}
-static int
+static int
eckey_param_decode(EVP_PKEY * pkey,
const unsigned char **pder, int derlen)
{
return 1;
}
-static int
+static int
eckey_param_encode(const EVP_PKEY * pkey, unsigned char **pder)
{
return i2d_ECParameters(pkey->pkey.ec, pder);
}
-static int
+static int
eckey_param_print(BIO * bp, const EVP_PKEY * pkey, int indent,
ASN1_PCTX * ctx)
{
return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0);
}
-static int
+static int
eckey_pub_print(BIO * bp, const EVP_PKEY * pkey, int indent,
ASN1_PCTX * ctx)
{
}
-static int
+static int
eckey_priv_print(BIO * bp, const EVP_PKEY * pkey, int indent,
ASN1_PCTX * ctx)
{
return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2);
}
-static int
+static int
old_ec_priv_decode(EVP_PKEY * pkey,
const unsigned char **pder, int derlen)
{
return 1;
}
-static int
+static int
old_ec_priv_encode(const EVP_PKEY * pkey, unsigned char **pder)
{
return i2d_ECPrivateKey(pkey->pkey.ec, pder);
}
-static int
+static int
ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2)
{
switch (op) {
-/* $OpenBSD: ec_asn1.c,v 1.37 2022/05/24 20:06:32 tb Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.38 2022/11/19 07:00:57 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
#include "asn1_locl.h"
#include "ec_lcl.h"
-int
+int
EC_GROUP_get_basis_type(const EC_GROUP * group)
{
int i = 0;
}
#ifndef OPENSSL_NO_EC2M
-int
+int
EC_GROUP_get_trinomial_basis(const EC_GROUP * group, unsigned int *k)
{
if (group == NULL)
return 1;
}
-int
+int
EC_GROUP_get_pentanomial_basis(const EC_GROUP * group, unsigned int *k1,
unsigned int *k2, unsigned int *k3)
{
.field_name = "p.onBasis",
.item = &ASN1_NULL_it,
},
-
+
},
{
.value = NID_X9_62_tpBasis,
.field_name = "p.tpBasis",
.item = &ASN1_INTEGER_it,
},
-
+
},
{
.value = NID_X9_62_ppBasis,
.field_name = "p.ppBasis",
.item = &X9_62_PENTANOMIAL_it,
},
-
+
},
};
.field_name = "p.prime",
.item = &ASN1_INTEGER_it,
},
-
+
},
{
.value = NID_X9_62_characteristic_two_field,
.field_name = "p.char_two",
.item = &X9_62_CHARACTERISTIC_TWO_it,
},
-
+
},
};
return (ok);
}
-static int
+static int
ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
{
BIGNUM *tmp_1 = NULL, *tmp_2 = NULL;
return (group);
}
-int
+int
i2d_ECPKParameters(const EC_GROUP * a, unsigned char **out)
{
int ret = 0;
return (NULL);
}
-int
+int
i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
{
int ret = 0, ok = 0;
return (ok ? ret : 0);
}
-int
+int
i2d_ECParameters(EC_KEY * a, unsigned char **out)
{
if (a == NULL) {
return ret;
}
-int
+int
i2o_ECPublicKey(const EC_KEY * a, unsigned char **out)
{
size_t buf_len = 0;
-/* $OpenBSD: ec_check.c,v 1.9 2018/07/15 16:27:39 tb Exp $ */
+/* $OpenBSD: ec_check.c,v 1.10 2022/11/19 07:00:57 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
#include "ec_lcl.h"
#include <openssl/err.h>
-int
+int
EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx)
{
int ret = 0;
-/* $OpenBSD: ec_curve.c,v 1.22 2022/06/30 11:14:47 tb Exp $ */
+/* $OpenBSD: ec_curve.c,v 1.23 2022/11/19 07:00:57 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
return ret;
}
-size_t
+size_t
EC_get_builtin_curves(EC_builtin_curve * r, size_t nitems)
{
size_t i, min;
-/* $OpenBSD: ec_err.c,v 1.14 2022/11/10 16:37:52 jsing Exp $ */
+/* $OpenBSD: ec_err.c,v 1.15 2022/11/19 07:00:57 tb Exp $ */
/* ====================================================================
* Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
*
#endif
-void
+void
ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
-/* $OpenBSD: ec_key.c,v 1.26 2021/04/20 17:23:37 tb Exp $ */
+/* $OpenBSD: ec_key.c,v 1.27 2022/11/19 07:00:57 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
return ret;
}
-void
+void
EC_KEY_free(EC_KEY * r)
{
int i;
return ret;
}
-int
+int
EC_KEY_up_ref(EC_KEY * r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC);
return (ok);
}
-int
+int
EC_KEY_check_key(const EC_KEY * eckey)
{
int ok = 0;
return (ok);
}
-int
+int
EC_KEY_set_public_key_affine_coordinates(EC_KEY * key, BIGNUM * x, BIGNUM * y)
{
BN_CTX *ctx = NULL;
return key->group;
}
-int
+int
EC_KEY_set_group(EC_KEY * key, const EC_GROUP * group)
{
if (key->meth->set_group != NULL &&
return key->priv_key;
}
-int
+int
EC_KEY_set_private_key(EC_KEY * key, const BIGNUM * priv_key)
{
if (key->meth->set_private != NULL &&
return key->pub_key;
}
-int
+int
EC_KEY_set_public_key(EC_KEY * key, const EC_POINT * pub_key)
{
if (key->meth->set_public != NULL &&
return (key->pub_key == NULL) ? 0 : 1;
}
-unsigned int
+unsigned int
EC_KEY_get_enc_flags(const EC_KEY * key)
{
return key->enc_flag;
}
-void
+void
EC_KEY_set_enc_flags(EC_KEY * key, unsigned int flags)
{
key->enc_flag = flags;
}
-point_conversion_form_t
+point_conversion_form_t
EC_KEY_get_conv_form(const EC_KEY * key)
{
return key->conv_form;
}
-void
+void
EC_KEY_set_conv_form(EC_KEY * key, point_conversion_form_t cform)
{
key->conv_form = cform;
return ex_data;
}
-void
+void
EC_KEY_set_asn1_flag(EC_KEY * key, int flag)
{
if (key->group != NULL)
EC_GROUP_set_asn1_flag(key->group, flag);
}
-int
+int
EC_KEY_precompute_mult(EC_KEY * key, BN_CTX * ctx)
{
if (key->group == NULL)
return EC_GROUP_precompute_mult(key->group, ctx);
}
-int
+int
EC_KEY_get_flags(const EC_KEY * key)
{
return key->flags;
}
-void
+void
EC_KEY_set_flags(EC_KEY * key, int flags)
{
key->flags |= flags;
}
-void
+void
EC_KEY_clear_flags(EC_KEY * key, int flags)
{
key->flags &= ~flags;
-/* $OpenBSD: ec_mult.c,v 1.24 2018/07/15 16:27:39 tb Exp $ */
+/* $OpenBSD: ec_mult.c,v 1.25 2022/11/19 07:00:57 tb Exp $ */
/*
* Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project.
*/
return src_;
}
-static void
+static void
ec_pre_comp_free(void *pre_)
{
int i;
free(pre);
}
-static void
+static void
ec_pre_comp_clear_free(void *pre_)
{
int i;
* scalar*generator
* in the addition if scalar != NULL
*/
-int
+int
ec_wNAF_mul(const EC_GROUP * group, EC_POINT * r, const BIGNUM * scalar,
size_t num, const EC_POINT * points[], const BIGNUM * scalars[], BN_CTX * ctx)
{
* points[2^(w-1)*numblocks-1] = (2^(w-1)) * 2^(blocksize*(numblocks-1)) * generator
* points[2^(w-1)*numblocks] = NULL
*/
-int
+int
ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
{
const EC_POINT *generator;
/*
* The following parameters mean we precompute (approximately) one
* point per bit.
- *
+ *
* TBD: The combination 8, 4 is perfect for 160 bits; for other bit
* lengths, other parameter combinations might provide better
* efficiency.
}
-int
+int
ec_wNAF_have_precompute_mult(const EC_GROUP * group)
{
if (EC_EX_DATA_get_data(group->extra_data, ec_pre_comp_dup, ec_pre_comp_free, ec_pre_comp_clear_free) != NULL)
-/* $OpenBSD: ec_pmeth.c,v 1.13 2021/12/04 16:08:32 tb Exp $ */
+/* $OpenBSD: ec_pmeth.c,v 1.14 2022/11/19 07:00:57 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
size_t kdf_outlen;
} EC_PKEY_CTX;
-static int
+static int
pkey_ec_init(EVP_PKEY_CTX * ctx)
{
EC_PKEY_CTX *dctx;
return 1;
}
-static int
+static int
pkey_ec_copy(EVP_PKEY_CTX * dst, EVP_PKEY_CTX * src)
{
EC_PKEY_CTX *dctx, *sctx;
return 1;
}
-static void
+static void
pkey_ec_cleanup(EVP_PKEY_CTX * ctx)
{
EC_PKEY_CTX *dctx = ctx->data;
}
}
-static int
+static int
pkey_ec_sign(EVP_PKEY_CTX * ctx, unsigned char *sig, size_t * siglen,
const unsigned char *tbs, size_t tbslen)
{
return 1;
}
-static int
+static int
pkey_ec_verify(EVP_PKEY_CTX * ctx,
const unsigned char *sig, size_t siglen,
const unsigned char *tbs, size_t tbslen)
return ret;
}
-static int
+static int
pkey_ec_derive(EVP_PKEY_CTX * ctx, unsigned char *key, size_t * keylen)
{
int ret;
return rv;
}
-static int
+static int
pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2)
{
EC_PKEY_CTX *dctx = ctx->data;
}
}
-static int
+static int
pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx, const char *type, const char *value)
{
if (!strcmp(type, "ec_paramgen_curve")) {
return -2;
}
-static int
+static int
pkey_ec_paramgen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey)
{
EC_KEY *ec = NULL;
return ret;
}
-static int
+static int
pkey_ec_keygen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey)
{
EC_KEY *ec = NULL;
-/* $OpenBSD: eck_prn.c,v 1.18 2022/11/10 12:37:00 tobhe Exp $ */
+/* $OpenBSD: eck_prn.c,v 1.19 2022/11/19 07:00:57 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
#include <openssl/err.h>
#include <openssl/evp.h>
-int
+int
ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off)
{
BIO *b;
return (ret);
}
-int
+int
EC_KEY_print_fp(FILE * fp, const EC_KEY * x, int off)
{
BIO *b;
return (ret);
}
-int
+int
ECParameters_print_fp(FILE * fp, const EC_KEY * x)
{
BIO *b;
return (ret);
}
-int
+int
EC_KEY_print(BIO * bp, const EC_KEY * x, int off)
{
EVP_PKEY *pk;
return ret;
}
-int
+int
ECParameters_print(BIO * bp, const EC_KEY * x)
{
EVP_PKEY *pk;
return ret;
}
-static int
+static int
print_bin(BIO * fp, const char *str, const unsigned char *num,
size_t len, int off);
-int
+int
ECPKParameters_print(BIO * bp, const EC_GROUP * x, int off)
{
unsigned char *buffer = NULL;
return (ret);
}
-static int
+static int
print_bin(BIO * fp, const char *name, const unsigned char *buf,
size_t len, int off)
{
-/* $OpenBSD: ecp_nistputil.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */
+/* $OpenBSD: ecp_nistputil.c,v 1.7 2022/11/19 07:00:57 tb Exp $ */
/*
* Written by Bodo Moeller for the OpenSSL project.
*/
* tmp_felems needs to point to a temporary array of 'num'+1 field elements
* for storage of intermediate values.
*/
-void
+void
ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array,
size_t felem_size, void *tmp_felems,
void (*felem_one) (void *out),
* has to be b_4 b_3 b_2 b_1 b_0 0.
*
*/
-void
+void
ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in)
{
unsigned char s, d;
-/* $OpenBSD: ecp_nistz256.c,v 1.11 2022/08/29 06:08:03 jsg Exp $ */
+/* $OpenBSD: ecp_nistz256.c,v 1.12 2022/11/19 07:00:57 tb Exp $ */
/* Copyright (c) 2014, Intel Corporation.
*
* Permission to use, copy, modify, and/or distribute this software for any
*/
BN_ULONG infty;
infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] |
- p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
+ p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
if (P256_LIMBS == 8)
infty |=
(p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] |
-/* $OpenBSD: ecp_oct.c,v 1.14 2021/04/20 17:32:57 tb Exp $ */
+/* $OpenBSD: ecp_oct.c,v 1.15 2022/11/19 07:00:57 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project.
* Includes code written by Bodo Moeller for the OpenSSL project.
#include "ec_lcl.h"
-int
+int
ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group,
EC_POINT * point, const BIGNUM * x_, int y_bit, BN_CTX * ctx)
{
}
-size_t
+size_t
ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_conversion_form_t form,
unsigned char *buf, size_t len, BN_CTX * ctx)
{
}
-int
+int
ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point,
const unsigned char *buf, size_t len, BN_CTX * ctx)
{
-/* $OpenBSD: ecp_smpl.c,v 1.34 2022/01/20 11:02:44 inoguchi Exp $ */
+/* $OpenBSD: ecp_smpl.c,v 1.35 2022/11/19 07:00:57 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project.
* Includes code written by Bodo Moeller for the OpenSSL project.
/*
* Apply randomization of EC point projective coordinates:
*
- * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z)
+ * (X, Y, Z) = (lambda^2 * X, lambda^3 * Y, lambda * Z)
*
* where lambda is in the interval [1, group->field).
*/
#define EC_POINT_BN_set_flags(P, flags) do { \
- BN_set_flags(&(P)->X, (flags)); \
- BN_set_flags(&(P)->Y, (flags)); \
- BN_set_flags(&(P)->Z, (flags)); \
+ BN_set_flags(&(P)->X, (flags)); \
+ BN_set_flags(&(P)->Y, (flags)); \
+ BN_set_flags(&(P)->Z, (flags)); \
} while(0)
-#define EC_POINT_CSWAP(c, a, b, w, t) do { \
+#define EC_POINT_CSWAP(c, a, b, w, t) do { \
if (!BN_swap_ct(c, &(a)->X, &(b)->X, w) || \
- !BN_swap_ct(c, &(a)->Y, &(b)->Y, w) || \
+ !BN_swap_ct(c, &(a)->Y, &(b)->Y, w) || \
!BN_swap_ct(c, &(a)->Z, &(b)->Z, w)) \
goto err; \
t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
-/* $OpenBSD: ecx_methods.c,v 1.1 2022/11/10 16:37:52 jsing Exp $ */
+/* $OpenBSD: ecx_methods.c,v 1.2 2022/11/19 07:00:57 tb Exp $ */
/*
* Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
*
{
const ASN1_OBJECT *aobj;
int nid, param_type;
-
+
X509_ALGOR_get0(&aobj, ¶m_type, NULL, algor);
nid = OBJ_obj2nid(aobj);