aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/point_gfp.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-02 15:16:45 +0000
committerlloyd <[email protected]>2010-03-02 15:16:45 +0000
commite60403e98ebe6b1dc5f1f512e1e06924ef07ba04 (patch)
treee55f60c7056b252f1c387446cfd6e96ed426d496 /src/math/numbertheory/point_gfp.h
parentfebfb73f1e260c9b98c57501f9d259b063755696 (diff)
Make two variants of OS2ECP, one taking pointer + length, and other
(inlined) taking a MemoryRegion& that just forwards. This makes it possible to avoid an extra copy in ECDH::derive_key.
Diffstat (limited to 'src/math/numbertheory/point_gfp.h')
-rw-r--r--src/math/numbertheory/point_gfp.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/math/numbertheory/point_gfp.h b/src/math/numbertheory/point_gfp.h
index 3bb763d44..2f31421fc 100644
--- a/src/math/numbertheory/point_gfp.h
+++ b/src/math/numbertheory/point_gfp.h
@@ -219,7 +219,12 @@ inline PointGFp operator*(const PointGFp& point, const BigInt& scalar)
// encoding and decoding
SecureVector<byte> BOTAN_DLL EC2OSP(const PointGFp& point, byte format);
-PointGFp BOTAN_DLL OS2ECP(const MemoryRegion<byte>& os, const CurveGFp& curve);
+
+PointGFp BOTAN_DLL OS2ECP(const byte data[], u32bit data_len,
+ const CurveGFp& curve);
+
+inline PointGFp OS2ECP(const MemoryRegion<byte>& data, const CurveGFp& curve)
+ { return OS2ECP(&data[0], data.size(), curve); }
}