[Sorry for top-post - Outlook Web Client] I would say that BN_CTX_init() is deprecated and you should be using BN_CTX * ctx = BN_CTX_new();
Indeed, https://www.openssl.org/docs/crypto/BN_CTX_new.html says BN_CTX_init() (deprecated) initializes an existing uninitialized BN_CTX. This should not be used for new programs. Use BN_CTX_new() instead. Regards, Carl ________________________________________ From: owner-openssl-us...@openssl.org [owner-openssl-us...@openssl.org] on behalf of Jeffrey Walton [noloa...@gmail.com] Sent: 16 January 2014 20:28 To: OpenSSL Users List Subject: Declare BN_CTX on stack (not BN_CTX*) I'm trying to declare a BN_CTX on the stack (with a subsequent call to BN_CTX_init) to stay out of the memory manager. When I do, I get an error: aggregate ‘BN_CTX’ has incomplete type and cannot be defined I've included <openssl/bn.h>, so I'm kind of surprised I can't compile. (<openssl/bn.h> has some typedefs and comments about definitions in ossl_typ.h). Grepping sources: $ grep -R BN_CTX_init * ... crypto/bn/exp.c: BN_CTX_init(&ctx); does not show me anything interesting because it looks like I'm doing what exp.c is doing: BN_CTX ctx; BIGNUM a,b,c,r,rr,t,l; ... BN_CTX_init(&ctx); How do I declare a BN_CTX on the stack? Thanks in advance. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org