> > BN_dec2bn (called above) actually has a pointer to pointer first argument 
> > (**BIGNUM).  Is there something special I have to do in the function 
> > signature, or when calling?  I'm pretending its just a pointer. 

> Pointer to a pointer means you need to put the pointer somewhere and 
get the address of that pointer and pass that address as the argument.

my code turns into something like


cocurrent 'ssl'
dec2BN=: ' BN_dec2bn + l *i *c' ssl

cocurrent 'bn' 

coinsert 'ssl' 
create =: 3 : 0 
I =: BNnew 0{.a. 
pD Ia =: > 15!:6 <'I' 
pD i=. dec2BN (Ia);(": y) 
2 {. i 
)

but this causes cder of 6 0.  whether firstdec param is *i or *l or *x.  
Crashes without the *.

is 15!:6 the wrong method to get the address of my variable?





----- Original Message -----
From: Raul Miller <rauldmil...@gmail.com>
To: Programming forum <programm...@jsoftware.com>
Cc: 
Sent: Wednesday, September 2, 2015 4:04 PM
Subject: Re: [Jprogramming] BigNum library from openssl

On Wed, Sep 2, 2015 at 3:28 PM, 'Pascal Jasmin' via Programming
<programm...@jsoftware.com> wrote:
> I don't really know what gets returned yet, but what is worrysome is that 
> repeated calls return slightly different values.

This crashes J
   bn2dec a

So it's wrong, and if you get a result at all you shouldn't be
surprised if it's an inconsistent result.

> Some issues I don't know how to deal with in the code below,
>
> BNnum_bytes is a macro, and error 2 0 occurs if I try to call it.  Is there a 
> workaround?

BN_num_bytes is a macro, it's probably something like ([:>.0.125*BN_num_bits)

> BN_dec2bn (called above) actually has a pointer to pointer first argument 
> (**BIGNUM).  Is there something special I have to do in the function 
> signature, or when calling?  I'm pretending its just a pointer.

Pointer to a pointer means you need to put the pointer somewhere and
get the address of that pointer and pass that address as the argument.

> BN_bn2dec has a function pointer type as its declaration, and I don't know if 
> I need to do something special for it.

I don't see that in the mentions of BN_bn2dec, here:

> the bn2... page
> https://www.openssl.org/docs/manmaster/crypto/BN_bn2bin.html

Looks to me like it takes an argument which is a pointer to a bignum
and returns a result which is a pointer to character (usually, but not
always, when working with C, that means it's not a single character
but an arbitrary length character sequence which is terminated by
0{a.)

Anyways, good start...

Thanks,


-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to