diff options
| author | tb <> | 2024-10-30 17:52:34 +0000 |
|---|---|---|
| committer | tb <> | 2024-10-30 17:52:34 +0000 |
| commit | cf40b8e16c2c5f14c8cc911c6f83456b7ccaaa97 (patch) | |
| tree | 0951e63bad39a0eca5909a775384435b33a4e47d /src/lib/libcrypto/ec/ec_local.h | |
| parent | eb7b0ca8c3d463a98cc53af2aca62395fa89674a (diff) | |
| download | openbsd-cf40b8e16c2c5f14c8cc911c6f83456b7ccaaa97.tar.gz openbsd-cf40b8e16c2c5f14c8cc911c6f83456b7ccaaa97.tar.bz2 openbsd-cf40b8e16c2c5f14c8cc911c6f83456b7ccaaa97.zip | |
Provide ec_point_from_octets()
This is a wrapper that is the reverse of ec_point_to_octets(). It is a
bit simpler since EC_POINT_oct2point() expects the point to be allocated
already. It also hands back the correctly parsed point conversion form
so that we don't have to do this by hand in a few places.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_local.h')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_local.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h index 7aa1c3f64e..148e94b766 100644 --- a/src/lib/libcrypto/ec/ec_local.h +++ b/src/lib/libcrypto/ec/ec_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_local.h,v 1.33 2024/10/30 06:10:35 tb Exp $ */ | 1 | /* $OpenBSD: ec_local.h,v 1.34 2024/10/30 17:52:34 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -360,8 +360,10 @@ int ec_group_is_builtin_curve(const EC_GROUP *group); | |||
| 360 | int ec_group_get_field_type(const EC_GROUP *group); | 360 | int ec_group_get_field_type(const EC_GROUP *group); |
| 361 | 361 | ||
| 362 | /* | 362 | /* |
| 363 | * Wrapper around the unergonomic EC_POINT_point2oct(). | 363 | * Wrappers around the unergonomic EC_POINT_{oct2point,point2oct}(). |
| 364 | */ | 364 | */ |
| 365 | int ec_point_from_octets(const EC_GROUP *group, const unsigned char *buf, | ||
| 366 | size_t buf_len, EC_POINT **out_point, uint8_t *out_form, BN_CTX *ctx_in); | ||
| 365 | int ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form, | 367 | int ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form, |
| 366 | unsigned char **out_buf, size_t *len, BN_CTX *ctx_in); | 368 | unsigned char **out_buf, size_t *len, BN_CTX *ctx_in); |
| 367 | 369 | ||
