I am in the process of writing wrappers around the crypto++
functions we need for our application security.

The following is one such wrapper function for ECDSA.

#include <cryptoPP/eccrypto.h>
#include <cryptoPP/ec2n.h>
#include <cryptoPP/asn.h>
#include <cryptoPP/osrng.h>
#include <cryptoPP/randpool.h>

using namespace CryptoPP;

byte *ECDSASignByteArray(byte *bData, byte *bPrivateKey)
{
        AutoSeededRandomPool rng;
        ECDSA<EC2N, SHA256>::Signer S(rng, ASN1::sect233k1) ;
        byte bSignature[S.SignatureLength()];
    S.SignMessage(rng, bData, 32, bSignature);
}

>From the trawling I have done through the manual, FAQ
postings etc, I believe this should work, however the
compiler does not recognise the ASN1 namespace, returning
the following error.

P:\Blaze\blaze_crypto\ecc.cpp(10) : error C2653: 'ASN1' : is
not a class or namespace name

Has anyone encountered similar problems and knows the
answer?

Suggestions much appreciated

Iain

Reply via email to