src/LLC/eckey.cpp
ECKey::ECKey(const uint32_t nID, const uint32_t nKeySizeIn)
    : pkey(nullptr)
    , fSet(false)
    , fCompressedPubKey(false)
    , nCurveID(nID)
    , nKeySize(nKeySizeIn)
    {

        /* Set the Curve Type. */
        switch(nID)
        {
        case SECT_571_R1:
            nCurveID = NID_sect571r1;
            break;
        case BRAINPOOL_P512_T1:
            nCurveID = NID_brainpoolP512t1;
            break;
        default:
            throw key_error("ECKey::ECKey() : Unrecognized EC Type");
        }

        /* Create a new key from the curve type. */
        pkey = EC_KEY_new_by_curve_name(nCurveID);

        /* Check for failure. */
        if(pkey == nullptr)
            throw key_error("ECKey::ECKey() : EC_KEY_new_by_curve_name failed");

    }
/* Constructor from a new curve type. */
Constructor from a new curve type.
Constructor from a new curve type .
ECKey::ECKey(const uint32_t nID, const uint32_t nKeySizeIn)
    : pkey(nullptr)
    , fSet(false)
    , fCompressedPubKey(false)
    , nCurveID(nID)
    , nKeySize(nKeySizeIn)
    {
        switch(nID)
        {
        case SECT_571_R1:
            nCurveID = NID_sect571r1;
            break;
        case BRAINPOOL_P512_T1:
            nCurveID = NID_brainpoolP512t1;
            break;
        default:
            throw key_error("ECKey::ECKey() : Unrecognized EC Type");
        }
        pkey = EC_KEY_new_by_curve_name(nCurveID);
        if(pkey == nullptr)
            throw key_error("ECKey::ECKey() : EC_KEY_new_by_curve_name failed");
    }
ECKey :: ECKey ( const uint32_t nID , const uint32_t nKeySizeIn ) : pkey ( nullptr ) , fSet ( false ) , fCompressedPubKey ( false ) , nCurveID ( nID ) , nKeySize ( nKeySizeIn ) { switch ( nID ) { case SECT_571_R1 : nCurveID = NID_sect571r1 ; break ; case BRAINPOOL_P512_T1 : nCurveID = NID_brainpoolP512t1 ; break ; default : throw key_error ( " " ) ; } pkey = EC_KEY_new_by_curve_name ( nCurveID ) ; if ( pkey == nullptr ) throw key_error ( " " ) ; }
Constructor from a new curve type.
Constructor from a new curve type .
/* Set the Curve Type. */ /* Create a new key from the curve type. */ /* Check for failure. */