aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ec_group/point_gfp.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-19 11:00:50 -0400
committerJack Lloyd <[email protected]>2018-03-20 09:36:40 -0400
commit737f33c09a18500e044dca3e2ae13bd2c08bafdd (patch)
tree95b8ae5d2750e1e78dd0e500c33c8c103e8bf42c /src/lib/pubkey/ec_group/point_gfp.h
parentb08f7beb877569fd94736c5a67b9e28fcdd968b6 (diff)
Store base point multiplies in a single std::vector
Since the point is public all the values are also, so this reduces pressure on the mlock allocator and may (slightly) help perf through cache read-ahead. Downside is cache based side channels are slightly easier (vs the data being stored in discontigious vectors). But we shouldn't rely on that in any case. And having it be in an array makes a masked table lookup easier to arrange.
Diffstat (limited to 'src/lib/pubkey/ec_group/point_gfp.h')
-rw-r--r--src/lib/pubkey/ec_group/point_gfp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/pubkey/ec_group/point_gfp.h b/src/lib/pubkey/ec_group/point_gfp.h
index aa7e5b2c0..80c198c62 100644
--- a/src/lib/pubkey/ec_group/point_gfp.h
+++ b/src/lib/pubkey/ec_group/point_gfp.h
@@ -148,6 +148,10 @@ class BOTAN_PUBLIC_API(2,0) PointGFp final
*/
BigInt get_affine_y() const;
+ const BigInt& get_x() const { return m_coord_x; }
+ const BigInt& get_y() const { return m_coord_y; }
+ const BigInt& get_z() const { return m_coord_z; }
+
/**
* Force this point to affine coordinates
*/
@@ -211,6 +215,10 @@ class BOTAN_PUBLIC_API(2,0) PointGFp final
*/
void add_affine(const PointGFp& other, std::vector<BigInt>& workspace);
+ void add_affine(const word x_words[], size_t x_size,
+ const word y_words[], size_t y_size,
+ std::vector<BigInt>& workspace);
+
/**
* Point doubling
* @param workspace temp space, at least WORKSPACE_SIZE elements