Skip to content

Commit

Permalink
Use the new EC_Group constructor in the TLS custom curve example
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed May 19, 2024
1 parent c4f51d4 commit f87e076
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/examples/tls_custom_curves_client.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define BOTAN_NO_DEPRECATED_WARNINGS

#include <botan/auto_rng.h>
#include <botan/certstor.h>
#include <botan/ecdh.h>
Expand Down Expand Up @@ -106,16 +104,16 @@ int main() {
const Botan::BigInt a("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40");
const Botan::BigInt b("0x25581");
const Botan::BigInt n("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE43C8275EA265C6020AB20294751A825");
const Botan::BigInt cofactor(1);

const Botan::BigInt g_x("0x01");
const Botan::BigInt g_y("0x696F1853C1E466D7FC82C96CCEEEDD6BD02C2F9375894EC10BF46306C2B56C77");

// You should assign your own OID
const Botan::OID oid("1.3.6.1.4.1.25258.0.0.0");
// This is an OID reserved in Botan's private arc for numsp256d1
// If you use some other curve you should create your own OID
const Botan::OID oid("1.3.6.1.4.1.25258.4.1");

// create EC_Group object to register the curve
Botan::EC_Group numsp256d1(p, a, b, g_x, g_y, n, cofactor, oid);
Botan::EC_Group numsp256d1(oid, p, a, b, g_x, g_y, n);

if(!numsp256d1.verify_group(*rng)) {
return 1;
Expand Down

0 comments on commit f87e076

Please sign in to comment.