NAME

EC_POINTS_new, EC_POINTS_free, EC_POINTS_clear_free, EC_POINTS_copy, EC_POINTS_dup, EC_POINTS_get_item, EC_POINTS_set_item, EC_POINTS_count, EC_POINTs_scalars_mul, EC_POINTs_scalar_mul, EC_POINTs_from_strings, EC_POINTs_from_strings_scalar_mul - Functions for performing batch computions of EC_POINT object

SYNOPSIS

 #include <openssl/ec.h>

EC_POINTS *EC_POINTS_new(const EC_GROUP *group, int count); void EC_POINTS_free(EC_POINTS *points); void EC_POINTS_clear_free(EC_POINTS *points); int EC_POINTS_copy(EC_POINTS *dst, const EC_POINTS *src); EC_POINTS *EC_POINTS_dup(const EC_POINTS *src, const EC_GROUP *group); EC_POINT *EC_POINTS_get_item(EC_POINTS *p, int i); int EC_POINTS_set_item(EC_POINTS *p, int i, EC_POINT *point); int EC_POINTS_count(EC_POINTS *p);

int EC_POINTs_scalars_mul(const EC_GROUP *group, EC_POINTS **r, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); int EC_POINTs_scalar_mul(const EC_GROUP *group, EC_POINTS **r, size_t num, const EC_POINT *points[], const BIGNUM *scalar, BN_CTX *ctx); int EC_POINTs_from_strings(const EC_GROUP *group, EC_POINTS **r, size_t num, const unsigned char *strings[], BN_CTX *ctx); int EC_POINTs_from_strings_scalar_mul(const EC_GROUP *group, EC_POINTS **r, size_t num, const unsigned char *strings[], const BIGNUM *scalar, BN_CTX *ctx);

DESCRIPTION

A EC_POINTS is a structure that holds an array of pointers to EC_POINT object.

EC_POINTS_new() allocates and initializes a EC_POINTS structure.

EC_POINTS_free() frees the components of the EC_POINTS and the structure itself. If points is NULL, nothing is done.

EC_POINTS_clear_free() destroys any sensitive data held within the EC_POINTS and then frees its memory. If point is NULL nothing is done.

EC_POINTS_copy() copies the point src into dst. Both src and dst must use the same EC_METHOD.

EC_POINTS_dup() creates a new EC_POINTS object and copies the content from src to the newly created EC_POINTS object.

EC_POINTS_get_item() gets the i-th EC_POINT object in EC_POINTS object.

EC_POINTS_set_item() set the EC_POINT object into p->items[i].

EC_POINTS_count() obtains the count of EC_POINT object in the EC_POINTS object.

EC_POINTs_scalars_mul() calculates scalar multiplication of batch points and places the result in r: r[i] = scalars[i] * points[i], which i = [0 .. num]. If the pointer r is NULL, then we allocate an EC_POINTS object to it, and you should free it after use.

EC_POINTs_scalar_mul() calculates scalar multiplication of batch points and places the result in r: r[i] = scalar * points[i], which i = [0 .. num]. If the pointer r is NULL, then we allocate an EC_POINTS object to it, and you should free it after use.

EC_POINTs_from_strings() converts some strings to some points on the elliptic curve and places the result in r: r[i]->X = hash(strings[i]), r[i]->Y = F(hash(strings[i])), the Y coordinate can be calculated by taking the X coordinate into the equation of elliptic curve, r[i]->Z = 1, which i = [0 .. num]. If the pointer r is NULL, then we allocate an EC_POINTS object to it, and you should free it after use.

EC_POINTs_from_strings_scalar_mul() converts some strings to some points on the elliptic curve similar, then multiply with scalar, and places the result in r: r[i] = scalar * point[i], which i = [0 .. num]. If the pointer r is NULL, then we allocate an EC_POINTS object to it, and you should free it after use.

RETURN VALUES

EC_POINTS_new() return the newly allocated EC_POINTS or NULL on error.

EC_POINTS_get_item() return the i-th EC_POINT object in EC_POINTS object.

The following functions return 1 on success or 0 on error: EC_POINTS_copy(), EC_POINTS_set_item(), EC_POINTs_scalars_mul(), EC_POINTs_scalar_mul(), EC_POINTs_from_strings() and EC_POINTs_from_strings_scalar_mul().

SEE ALSO

EC_POINT_new(3), EC_POINTs_mul(3), EC_POINT_mul(3)

COPYRIGHT

Copyright 2022 The BabaSSL Project Authors. All Rights Reserved.

Licensed under the BabaSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://github.com/BabaSSL/BabaSSL/blob/master/LICENSE.