[Jprogramming] md5 is not md5
j602: load'convert/misc/md5' md5 'example' 1a79a4d60de6718e8e5b326e338ae533 j64-802: load'convert/misc/md5' md5 'example' 64a9df64d8defee229d86709a425ea7a This is a problem... == Raul -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
Wow! I wonder which hash is the correct md5 hash? Where did the code for each of them come from? Skip Skip Cave Cave Consulting LLC On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller wrote: > j602: > >load'convert/misc/md5' >md5 'example' > 1a79a4d60de6718e8e5b326e338ae533 > > j64-802: > >load'convert/misc/md5' >md5 'example' > 64a9df64d8defee229d86709a425ea7a > > This is a problem... > > == > 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
Re: [Jprogramming] md5 is not md5
I computed the hash in Python and the J602 version matches: import hashlib m = hashlib.md5()m.update('example')m.hexdigest() gives: '1a79a4d60de6718e8e5b326e338ae533' Also any number of online md5 checkers give the same result to J602. > Date: Sat, 6 Sep 2014 08:21:59 -0500 > From: s...@caveconsulting.com > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] md5 is not md5 > > Wow! I wonder which hash is the correct md5 hash? Where did the code for > each of them come from? > > Skip > > Skip Cave > Cave Consulting LLC > > > On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller wrote: > > > j602: > > > >load'convert/misc/md5' > >md5 'example' > > 1a79a4d60de6718e8e5b326e338ae533 > > > > j64-802: > > > >load'convert/misc/md5' > >md5 'example' > > 64a9df64d8defee229d86709a425ea7a > > > > This is a problem... > > > > == > > 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 -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
I got the 1a7... on android j802. I suspect this is a J64 bug. On Sep 6, 2014 9:43 PM, "Jon Hough" wrote: > > > > I computed the hash in Python and the J602 version matches: > import hashlib > m = hashlib.md5()m.update('example')m.hexdigest() > gives: > '1a79a4d60de6718e8e5b326e338ae533' > Also any number of online md5 checkers give the same result to J602. > > > Date: Sat, 6 Sep 2014 08:21:59 -0500 > > From: s...@caveconsulting.com > > To: programm...@jsoftware.com > > Subject: Re: [Jprogramming] md5 is not md5 > > > > Wow! I wonder which hash is the correct md5 hash? Where did the code for > > each of them come from? > > > > Skip > > > > Skip Cave > > Cave Consulting LLC > > > > > > On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller > wrote: > > > > > j602: > > > > > >load'convert/misc/md5' > > >md5 'example' > > > 1a79a4d60de6718e8e5b326e338ae533 > > > > > > j64-802: > > > > > >load'convert/misc/md5' > > >md5 'example' > > > 64a9df64d8defee229d86709a425ea7a > > > > > > This is a problem... > > > > > > == > > > 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 > > > -- > For information about J forums see http://www.jsoftware.com/forums.htm > -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
The j602 version is correct, and the same code is used in each. The problem seems to be that the code was designed for 32 bit integers. Note also that the reference C implementation based on RFC 1321 (http://www.rfc-editor.org/rfc/rfc1321.txt) gives exactly the same results on 32 bit and 64 bit machines. (In other words it gives the same wrong result when compiled with -m64 that J64-802 gives.) So that means I can't just use a C implementation of md5sum compiled with -m64 to work around this issue (and I can't link to C code compiled with -m32 from 64 bit J). Solvable, certainly, but annoying... Thanks, -- Raul On Sat, Sep 6, 2014 at 9:21 AM, Skip Cave wrote: > Wow! I wonder which hash is the correct md5 hash? Where did the code for > each of them come from? > > Skip > > Skip Cave > Cave Consulting LLC > > > On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller wrote: > >> j602: >> >>load'convert/misc/md5' >>md5 'example' >> 1a79a4d60de6718e8e5b326e338ae533 >> >> j64-802: >> >>load'convert/misc/md5' >>md5 'example' >> 64a9df64d8defee229d86709a425ea7a >> >> This is a problem... >> >> == >> 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 -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
the code in rfc assume long int (uint4) is 4 bytes which should be valid in the era of 80386. On Sep 6, 2014 10:05 PM, "Raul Miller" wrote: > The j602 version is correct, and the same code is used in each. > > The problem seems to be that the code was designed for 32 bit integers. > > Note also that the reference C implementation based on RFC 1321 > (http://www.rfc-editor.org/rfc/rfc1321.txt) gives exactly the same > results on 32 bit and 64 bit machines. (In other words it gives the same > wrong result when compiled with -m64 that J64-802 gives.) > > So that means I can't just use a C implementation of md5sum compiled > with -m64 to work around this issue (and I can't link to C code > compiled with -m32 from 64 bit J). > > Solvable, certainly, but annoying... > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 9:21 AM, Skip Cave wrote: > > Wow! I wonder which hash is the correct md5 hash? Where did the code for > > each of them come from? > > > > Skip > > > > Skip Cave > > Cave Consulting LLC > > > > > > On Sat, Sep 6, 2014 at 8:10 AM, Raul Miller > wrote: > > > >> j602: > >> > >>load'convert/misc/md5' > >>md5 'example' > >> 1a79a4d60de6718e8e5b326e338ae533 > >> > >> j64-802: > >> > >>load'convert/misc/md5' > >>md5 'example' > >> 64a9df64d8defee229d86709a425ea7a > >> > >> This is a problem... > >> > >> == > >> 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 > -- > For information about J forums see http://www.jsoftware.com/forums.htm > -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
It was written and tested for 32 bits. J7-64 also gives the wrong answer. At the bottom of this page there are openssl bindings to similar hashes. http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows all the bound hashes are the same speed when called, but I added an md5 implementation this morning. IIRC it is over 1000 times faster than the J code. I possibly made the unpopular design decision to split out the formatting of the hash and keep it raw binary. There is a 5x performance benefit for doing so. the fastest conversion (but takes more space than binary) is listhash =: (a. i. ])@: or: a. i. md5 'example' If you are having any problems with the library, the source is likely in the first 3 lines. I didn't test with 32 bits, but any problems there are likely solveable. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 9:10 AM Subject: [Jprogramming] md5 is not md5 j602: load'convert/misc/md5' md5 'example' 1a79a4d60de6718e8e5b326e338ae533 j64-802: load'convert/misc/md5' md5 'example' 64a9df64d8defee229d86709a425ea7a This is a problem... == 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
Re: [Jprogramming] md5 is not md5
I can't use your implementation, since I'm not running this on windows. That said, I've got a fix for my code. That said, I do not have a fix for the portable code in convert/misc/md5. The first thing which would need to be fixed there are the uses of 32 b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but oddly enough that does not seem to be sufficient. It's not obvious to me what else needs to be fixed, and right now I am feeling too impatient to isolate the problem. Thanks, -- Raul On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming wrote: > It was written and tested for 32 bits. J7-64 also gives the wrong answer. > > At the bottom of this page there are openssl bindings to similar hashes. > http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows > > all the bound hashes are the same speed when called, but I added an md5 > implementation this morning. IIRC it is over 1000 times faster than the J > code. > > I possibly made the unpopular design decision to split out the formatting of > the hash and keep it raw binary. There is a 5x performance benefit for doing > so. > > the fastest conversion (but takes more space than binary) is > > listhash =: (a. i. ])@: > > or: > a. i. md5 'example' > > If you are having any problems with the library, the source is likely in the > first 3 lines. I didn't test with 32 bits, but any problems there are likely > solveable. > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 9:10 AM > Subject: [Jprogramming] md5 is not md5 > > j602: > >load'convert/misc/md5' >md5 'example' > 1a79a4d60de6718e8e5b326e338ae533 > > j64-802: > >load'convert/misc/md5' >md5 'example' > 64a9df64d8defee229d86709a425ea7a > > This is a problem... > > == > 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 -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
the code was tested at one point on mac. There is an attempt in the definitions (at bottom of page only) to link on linux. assumes /usr/lib/libssl.so . Should work? or few changes needed to work on linux? - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:11 AM Subject: Re: [Jprogramming] md5 is not md5 I can't use your implementation, since I'm not running this on windows. That said, I've got a fix for my code. That said, I do not have a fix for the portable code in convert/misc/md5. The first thing which would need to be fixed there are the uses of 32 b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but oddly enough that does not seem to be sufficient. It's not obvious to me what else needs to be fixed, and right now I am feeling too impatient to isolate the problem. Thanks, -- Raul On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming wrote: > It was written and tested for 32 bits. J7-64 also gives the wrong answer. > > At the bottom of this page there are openssl bindings to similar hashes. > http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows > > all the bound hashes are the same speed when called, but I added an md5 > implementation this morning. IIRC it is over 1000 times faster than the J > code. > > I possibly made the unpopular design decision to split out the formatting of > the hash and keep it raw binary. There is a 5x performance benefit for doing > so. > > the fastest conversion (but takes more space than binary) is > > listhash =: (a. i. ])@: > > or: > a. i. md5 'example' > > If you are having any problems with the library, the source is likely in the > first 3 lines. I didn't test with 32 bits, but any problems there are likely > solveable. > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 9:10 AM > Subject: [Jprogramming] md5 is not md5 > > j602: > >load'convert/misc/md5' >md5 'example' > 1a79a4d60de6718e8e5b326e338ae533 > > j64-802: > >load'convert/misc/md5' >md5 'example' > 64a9df64d8defee229d86709a425ea7a > > This is a problem... > > == > 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 -- For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
I tried your code at http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows sha256 hexhash 'The quick brown fox jumps over the lazy dog' |domain error: cd | CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT Meanwhile, what I have works for me. Specifically, I built libmd5.so using https://github.com/rdm/libmd5.so, copied it into the directory /home/ubuntu/bin/ and then used, from in J: md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' Now... since I need both 32 bit J (to parse xml using xml/sax - apparently that only works on 32 bit j602) and 64 bit J (to deal with more data than will fit in a 32 bit process), I'm having to have two copies of libmd5.so - one for each instance of J. But I can live with that. Thanks, -- Raul On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming wrote: > the code was tested at one point on mac. There is an attempt in the > definitions (at bottom of page only) to link on linux. assumes > /usr/lib/libssl.so . Should work? or few changes needed to work on linux? > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:11 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I can't use your implementation, since I'm not running this on windows. > > That said, I've got a fix for my code. > > That said, I do not have a fix for the portable code in convert/misc/md5. > > The first thing which would need to be fixed there are the uses of 32 > b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but > oddly enough that does not seem to be sufficient. It's not obvious to > me what else needs to be fixed, and right now I am feeling too > impatient to isolate the problem. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming > wrote: >> It was written and tested for 32 bits. J7-64 also gives the wrong answer. >> >> At the bottom of this page there are openssl bindings to similar hashes. >> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >> >> all the bound hashes are the same speed when called, but I added an md5 >> implementation this morning. IIRC it is over 1000 times faster than the J >> code. >> >> I possibly made the unpopular design decision to split out the formatting of >> the hash and keep it raw binary. There is a 5x performance benefit for >> doing so. >> >> the fastest conversion (but takes more space than binary) is >> >> listhash =: (a. i. ])@: >> >> or: >> a. i. md5 'example' >> >> If you are having any problems with the library, the source is likely in the >> first 3 lines. I didn't test with 32 bits, but any problems there are >> likely solveable. >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 9:10 AM >> Subject: [Jprogramming] md5 is not md5 >> >> j602: >> >>load'convert/misc/md5' >>md5 'example' >> 1a79a4d60de6718e8e5b326e338ae533 >> >> j64-802: >> >>load'convert/misc/md5' >>md5 'example' >> 64a9df64d8defee229d86709a425ea7a >> >> This is a problem... >> >> == >> 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 > -- > For information about J forums see http://www.jsoftware.com/forums.htm > > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
You are using the wrong code. That is indeed windows specific bindings. The openssl bindings are at the bottom of the page. Though you may want to pick up hexhash definition from the top section. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:41 AM Subject: Re: [Jprogramming] md5 is not md5 I tried your code at http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows sha256 hexhash 'The quick brown fox jumps over the lazy dog' |domain error: cd | CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT Meanwhile, what I have works for me. Specifically, I built libmd5.so using https://github.com/rdm/libmd5.so, copied it into the directory /home/ubuntu/bin/ and then used, from in J: md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' Now... since I need both 32 bit J (to parse xml using xml/sax - apparently that only works on 32 bit j602) and 64 bit J (to deal with more data than will fit in a 32 bit process), I'm having to have two copies of libmd5.so - one for each instance of J. But I can live with that. Thanks, -- Raul On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming wrote: > the code was tested at one point on mac. There is an attempt in the > definitions (at bottom of page only) to link on linux. assumes > /usr/lib/libssl.so . Should work? or few changes needed to work on linux? > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:11 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I can't use your implementation, since I'm not running this on windows. > > That said, I've got a fix for my code. > > That said, I do not have a fix for the portable code in convert/misc/md5. > > The first thing which would need to be fixed there are the uses of 32 > b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but > oddly enough that does not seem to be sufficient. It's not obvious to > me what else needs to be fixed, and right now I am feeling too > impatient to isolate the problem. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming > wrote: >> It was written and tested for 32 bits. J7-64 also gives the wrong answer. >> >> At the bottom of this page there are openssl bindings to similar hashes. >> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >> >> all the bound hashes are the same speed when called, but I added an md5 >> implementation this morning. IIRC it is over 1000 times faster than the J >> code. >> >> I possibly made the unpopular design decision to split out the formatting of >> the hash and keep it raw binary. There is a 5x performance benefit for >> doing so. >> >> the fastest conversion (but takes more space than binary) is >> >> listhash =: (a. i. ])@: >> >> or: >> a. i. md5 'example' >> >> If you are having any problems with the library, the source is likely in the >> first 3 lines. I didn't test with 32 bits, but any problems there are >> likely solveable. >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 9:10 AM >> Subject: [Jprogramming] md5 is not md5 >> >> j602: >> >>load'convert/misc/md5' >>md5 'example' >> 1a79a4d60de6718e8e5b326e338ae533 >> >> j64-802: >> >>load'convert/misc/md5' >>md5 'example' >> 64a9df64d8defee229d86709a425ea7a >> >> This is a problem... >> >> == >> 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 > -- > For information about J forums see http://www.jsoftware.com/forums.htm > > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
I used the code from the bottom of the page. Quite possibly I should have used it differently, but that's a different issue. Thanks, -- Raul On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming wrote: > You are using the wrong code. That is indeed windows specific bindings. The > openssl bindings are at the bottom of the page. Though you may want to pick > up hexhash definition from the top section. > > > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:41 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I tried your code at > http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows > >sha256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > | > CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT > > Meanwhile, what I have works for me. > > Specifically, I built libmd5.so using > https://github.com/rdm/libmd5.so, copied it into the directory > /home/ubuntu/bin/ and then used, from in J: > > md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) > md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' > > Now... since I need both 32 bit J (to parse xml using xml/sax - > apparently that only works on 32 bit j602) and 64 bit J (to deal with > more data than will fit in a 32 bit process), I'm having to have two > copies of libmd5.so - one for each instance of J. But I can live with > that. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming > wrote: >> the code was tested at one point on mac. There is an attempt in the >> definitions (at bottom of page only) to link on linux. assumes >> /usr/lib/libssl.so . Should work? or few changes needed to work on linux? >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:11 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I can't use your implementation, since I'm not running this on windows. >> >> That said, I've got a fix for my code. >> >> That said, I do not have a fix for the portable code in convert/misc/md5. >> >> The first thing which would need to be fixed there are the uses of 32 >> b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but >> oddly enough that does not seem to be sufficient. It's not obvious to >> me what else needs to be fixed, and right now I am feeling too >> impatient to isolate the problem. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming >> wrote: >>> It was written and tested for 32 bits. J7-64 also gives the wrong answer. >>> >>> At the bottom of this page there are openssl bindings to similar hashes. >>> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >>> >>> all the bound hashes are the same speed when called, but I added an md5 >>> implementation this morning. IIRC it is over 1000 times faster than the J >>> code. >>> >>> I possibly made the unpopular design decision to split out the formatting >>> of the hash and keep it raw binary. There is a 5x performance benefit for >>> doing so. >>> >>> the fastest conversion (but takes more space than binary) is >>> >>> listhash =: (a. i. ])@: >>> >>> or: >>> a. i. md5 'example' >>> >>> If you are having any problems with the library, the source is likely in >>> the first 3 lines. I didn't test with 32 bits, but any problems there are >>> likely solveable. >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 9:10 AM >>> Subject: [Jprogramming] md5 is not md5 >>> >>> j602: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 1a79a4d60de6718e8e5b326e338ae533 >>> >>> j64-802: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 64a9df64d8defee229d86709a425ea7a >>> >>> This is a problem... >>> >>> == >>> 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 >> -- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> -- >> For information about J forums see http://www.jsoftware.com/forums.htm > -- > For information about J forums see http://www.jsoftware.com/forums.htm > > -- > For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
You did not go far enough down the page :P CryptAcquireContext is only used in the MSFT binding not openssl binding - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:49 AM Subject: Re: [Jprogramming] md5 is not md5 I used the code from the bottom of the page. Quite possibly I should have used it differently, but that's a different issue. Thanks, -- Raul On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming wrote: > You are using the wrong code. That is indeed windows specific bindings. The > openssl bindings are at the bottom of the page. Though you may want to pick > up hexhash definition from the top section. > > > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:41 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I tried your code at > http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows > >sha256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > | > CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT > > Meanwhile, what I have works for me. > > Specifically, I built libmd5.so using > https://github.com/rdm/libmd5.so, copied it into the directory > /home/ubuntu/bin/ and then used, from in J: > > md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) > md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' > > Now... since I need both 32 bit J (to parse xml using xml/sax - > apparently that only works on 32 bit j602) and 64 bit J (to deal with > more data than will fit in a 32 bit process), I'm having to have two > copies of libmd5.so - one for each instance of J. But I can live with > that. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming > wrote: >> the code was tested at one point on mac. There is an attempt in the >> definitions (at bottom of page only) to link on linux. assumes >> /usr/lib/libssl.so . Should work? or few changes needed to work on linux? >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:11 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I can't use your implementation, since I'm not running this on windows. >> >> That said, I've got a fix for my code. >> >> That said, I do not have a fix for the portable code in convert/misc/md5. >> >> The first thing which would need to be fixed there are the uses of 32 >> b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but >> oddly enough that does not seem to be sufficient. It's not obvious to >> me what else needs to be fixed, and right now I am feeling too >> impatient to isolate the problem. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming >> wrote: >>> It was written and tested for 32 bits. J7-64 also gives the wrong answer. >>> >>> At the bottom of this page there are openssl bindings to similar hashes. >>> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >>> >>> all the bound hashes are the same speed when called, but I added an md5 >>> implementation this morning. IIRC it is over 1000 times faster than the J >>> code. >>> >>> I possibly made the unpopular design decision to split out the formatting >>> of the hash and keep it raw binary. There is a 5x performance benefit for >>> doing so. >>> >>> the fastest conversion (but takes more space than binary) is >>> >>> listhash =: (a. i. ])@: >>> >>> or: >>> a. i. md5 'example' >>> >>> If you are having any problems with the library, the source is likely in >>> the first 3 lines. I didn't test with 32 bits, but any problems there are >>> likely solveable. >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 9:10 AM >>> Subject: [Jprogramming] md5 is not md5 >>> >>> j602: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 1a79a4d60de6718e8e5b326e338ae533 >>> >>> j64-802: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 64a9df64d8defee229d86709a425ea7a >>> >>> This is a problem... >>> >>> == >>> 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 >> -- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> -- >> For information about J forums see http://www.jsoftware.com/forums.htm > --
Re: [Jprogramming] md5 is not md5
also, the openssl sha256 verb is called s256. - Original Message - From: 'Pascal Jasmin' via Programming To: "programm...@jsoftware.com" Cc: Sent: Saturday, September 6, 2014 11:52 AM Subject: Re: [Jprogramming] md5 is not md5 You did not go far enough down the page :P CryptAcquireContext is only used in the MSFT binding not openssl binding - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:49 AM Subject: Re: [Jprogramming] md5 is not md5 I used the code from the bottom of the page. Quite possibly I should have used it differently, but that's a different issue. Thanks, -- Raul On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming wrote: > You are using the wrong code. That is indeed windows specific bindings. The > openssl bindings are at the bottom of the page. Though you may want to pick > up hexhash definition from the top section. > > > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:41 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I tried your code at > http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows > >sha256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > | > CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT > > Meanwhile, what I have works for me. > > Specifically, I built libmd5.so using > https://github.com/rdm/libmd5.so, copied it into the directory > /home/ubuntu/bin/ and then used, from in J: > > md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) > md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' > > Now... since I need both 32 bit J (to parse xml using xml/sax - > apparently that only works on 32 bit j602) and 64 bit J (to deal with > more data than will fit in a 32 bit process), I'm having to have two > copies of libmd5.so - one for each instance of J. But I can live with > that. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming > wrote: >> the code was tested at one point on mac. There is an attempt in the >> definitions (at bottom of page only) to link on linux. assumes >> /usr/lib/libssl.so . Should work? or few changes needed to work on linux? >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:11 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I can't use your implementation, since I'm not running this on windows. >> >> That said, I've got a fix for my code. >> >> That said, I do not have a fix for the portable code in convert/misc/md5. >> >> The first thing which would need to be fixed there are the uses of 32 >> b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but >> oddly enough that does not seem to be sufficient. It's not obvious to >> me what else needs to be fixed, and right now I am feeling too >> impatient to isolate the problem. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming >> wrote: >>> It was written and tested for 32 bits. J7-64 also gives the wrong answer. >>> >>> At the bottom of this page there are openssl bindings to similar hashes. >>> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >>> >>> all the bound hashes are the same speed when called, but I added an md5 >>> implementation this morning. IIRC it is over 1000 times faster than the J >>> code. >>> >>> I possibly made the unpopular design decision to split out the formatting >>> of the hash and keep it raw binary. There is a 5x performance benefit for >>> doing so. >>> >>> the fastest conversion (but takes more space than binary) is >>> >>> listhash =: (a. i. ])@: >>> >>> or: >>> a. i. md5 'example' >>> >>> If you are having any problems with the library, the source is likely in >>> the first 3 lines. I didn't test with 32 bits, but any problems there are >>> likely solveable. >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 9:10 AM >>> Subject: [Jprogramming] md5 is not md5 >>> >>> j602: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 1a79a4d60de6718e8e5b326e338ae533 >>> >>> j64-802: >>> >>>load'convert/misc/md5' >>>md5 'example' >>> 64a9df64d8defee229d86709a425ea7a >>> >>> This is a problem... >>> >>> == >>> 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 >> -- >> For information about J fo
Re: [Jprogramming] md5 is not md5
Here's what happens if I use that code and only extract hexhash from the top (instead of simply incorporating both blocks of code): s256 hexhash 'The quick brown fox jumps over the lazy dog' |value error: sslSha256 | sslSha256(y);(#y);md=.32#' ' So, ok, what's wrong with sslSha256? sslSha256 |value error: sslSha256 sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x *c') ssl NB. SHA256 i *c l *c' ssl |value error: OPENSSL | (OPENSSL,m)&cd So, ok, what's wrong with OPENSSL? OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. wrote: > You did not go far enough down the page :P CryptAcquireContext is only used > in the MSFT binding not openssl binding > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:49 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I used the code from the bottom of the page. > > Quite possibly I should have used it differently, but that's a different > issue. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming > wrote: >> You are using the wrong code. That is indeed windows specific bindings. >> The openssl bindings are at the bottom of the page. Though you may want to >> pick up hexhash definition from the top section. >> >> >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:41 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I tried your code at >> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >> >>sha256 hexhash 'The quick brown fox jumps over the lazy dog' >> |domain error: cd >> | >> CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT >> >> Meanwhile, what I have works for me. >> >> Specifically, I built libmd5.so using >> https://github.com/rdm/libmd5.so, copied it into the directory >> /home/ubuntu/bin/ and then used, from in J: >> >> md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) >> md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' >> >> Now... since I need both 32 bit J (to parse xml using xml/sax - >> apparently that only works on 32 bit j602) and 64 bit J (to deal with >> more data than will fit in a 32 bit process), I'm having to have two >> copies of libmd5.so - one for each instance of J. But I can live with >> that. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming >> wrote: >>> the code was tested at one point on mac. There is an attempt in the >>> definitions (at bottom of page only) to link on linux. assumes >>> /usr/lib/libssl.so . Should work? or few changes needed to work on linux? >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 11:11 AM >>> Subject: Re: [Jprogramming] md5 is not md5 >>> >>> I can't use your implementation, since I'm not running this on windows. >>> >>> That said, I've got a fix for my code. >>> >>> That said, I do not have a fix for the portable code in convert/misc/md5. >>> >>> The first thing which would need to be fixed there are the uses of 32 >>> b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but >>> oddly enough that does not seem to be sufficient. It's not obvious to >>> me what else needs to be fixed, and right now I am feeling too >>> impatient to isolate the problem. >>> >>> Thanks, >>> >>> -- >>> Raul >>> >>> >>> On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming >>> wrote: It was written and tested for 32 bits. J7-64 also gives the wrong answer. At the bottom of this page there are openssl bindings to similar hashes. http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows all the bound hashes are the same speed when called, but I added an md5 implementation this morning. IIRC it is over 1000 times faster than the J code. I possibly made the unpopular design decision to split out the formatting of the hash and keep it raw binary. There is a 5x performance benefit for doing so. the fastest conversion (but takes more space than binary) is listhash =: (a. i. ])@: or: a. i. md5 'example' If you are having any problems with the library, the source is likely in the first 3 lines. I didn't test with 32 bits, but any problems there are likely solveable. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 9:10 AM Subject: [Jprogramming] md5 is not md5 j602: load'convert/misc/md5' md5 'example' 1a79a4d60de6718e8e5b326e338ae533 j64-802: load'convert/misc/md5' md5 'example'
Re: [Jprogramming] md5 is not md5
what is sslp defined as? Is it possible IFIOS is not defined? or less likely UNAME_z_? - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:57 AM Subject: Re: [Jprogramming] md5 is not md5 Here's what happens if I use that code and only extract hexhash from the top (instead of simply incorporating both blocks of code): s256 hexhash 'The quick brown fox jumps over the lazy dog' |value error: sslSha256 | sslSha256(y);(#y);md=.32#' ' So, ok, what's wrong with sslSha256? sslSha256 |value error: sslSha256 sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x *c') ssl NB. SHA256 i *c l *c' ssl |value error: OPENSSL | (OPENSSL,m)&cd So, ok, what's wrong with OPENSSL? OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. wrote: > You did not go far enough down the page :P CryptAcquireContext is only used > in the MSFT binding not openssl binding > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:49 AM > Subject: Re: [Jprogramming] md5 is not md5 > > I used the code from the bottom of the page. > > Quite possibly I should have used it differently, but that's a different > issue. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming > wrote: >> You are using the wrong code. That is indeed windows specific bindings. >> The openssl bindings are at the bottom of the page. Though you may want to >> pick up hexhash definition from the top section. >> >> >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:41 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I tried your code at >> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >> >>sha256 hexhash 'The quick brown fox jumps over the lazy dog' >> |domain error: cd >> | >> CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT >> >> Meanwhile, what I have works for me. >> >> Specifically, I built libmd5.so using >> https://github.com/rdm/libmd5.so, copied it into the directory >> /home/ubuntu/bin/ and then used, from in J: >> >> md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) >> md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' >> >> Now... since I need both 32 bit J (to parse xml using xml/sax - >> apparently that only works on 32 bit j602) and 64 bit J (to deal with >> more data than will fit in a 32 bit process), I'm having to have two >> copies of libmd5.so - one for each instance of J. But I can live with >> that. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming >> wrote: >>> the code was tested at one point on mac. There is an attempt in the >>> definitions (at bottom of page only) to link on linux. assumes >>> /usr/lib/libssl.so . Should work? or few changes needed to work on linux? >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 11:11 AM >>> Subject: Re: [Jprogramming] md5 is not md5 >>> >>> I can't use your implementation, since I'm not running this on windows. >>> >>> That said, I've got a fix for my code. >>> >>> That said, I do not have a fix for the portable code in convert/misc/md5. >>> >>> The first thing which would need to be fixed there are the uses of 32 >>> b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but >>> oddly enough that does not seem to be sufficient. It's not obvious to >>> me what else needs to be fixed, and right now I am feeling too >>> impatient to isolate the problem. >>> >>> Thanks, >>> >>> -- >>> Raul >>> >>> >>> On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming >>> wrote: It was written and tested for 32 bits. J7-64 also gives the wrong answer. At the bottom of this page there are openssl bindings to similar hashes. http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows all the bound hashes are the same speed when called, but I added an md5 implementation this morning. IIRC it is over 1000 times faster than the J code. I possibly made the unpopular design decision to split out the formatting of the hash and keep it raw binary. There is a 5x performance benefit for doing so. the fastest conversion (but takes more space than binary) is listhash =: (a. i. ])@: or: a. i. md5 'example' If you are having any problems with the library, the source is likely in the first 3 lines. I didn't test with 32 bits, but any problems there are likely solveable. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September
[Jprogramming] Ragged Array Shapes are Trees
I just came to the realization that ragged array shapes, regardless of how you want to represent them, are trees. I would be interested in any references to prior exploration of this idea. Some example data (boxes are used to display ragged arrays, but otherwise have no semantic meaning): ] A =. i. 2 3 0 1 2 3 4 5 ] B =. (< @ i."0) 1+i.2 +-+---+ |0|0 1| +-+---+ ] C =. A ; B +-+-+---+ |0 1 2|0|0 1| |3 4 5| | | +-+-+---+ ] D =. A ; < B +-+---+ |0 1 2|+-+---+| |3 4 5||0|0 1|| | |+-+---+| +-+---+ The corresponding shape trees (monospace font required, root node is on the left): A: 2 - 3 1 / B: 2 \ 2 2 - 3 / C: 3 - 1 \ 2 2 - 3 / D: 2 1 \ / 2 \ 2 In some sense the shape tree for A is compressed, the verbose alternative being: 3 / A: 2 \ 3 Compressing D in a similar manner leaves the full shape of the tree ambiguous - there is no way to distinguish the duplicate structure of leaf 3 from the structure of leaves 1, 2. 3 / D: 2 - 2 - 1 \ 2 We could resolving this ambiguity by listing the shapes of all the items explicitly. The problem here is that 'compression' could very easily lead to an increase in representation size, although it is nice and uniform for ragged arrays of uniform rank. 3 / | 3 | / D: 2 - 2 + | \ | 1 \ 2 Regardless of compression, I would be interested in prior work in representing shapes of ragged arrays as trees. Cheers, Mike -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
IFIOS 0 UNAME_z_ Linux sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' sslp /usr/lib/ Looking closer, I'm thinking you probably want /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so (which does not exist). That said, the domain error is because you are trying to compute this result: '/usr/lib/',2$<'libssl.so' Thanks, -- Raul On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming wrote: > what is sslp defined as? > > Is it possible IFIOS is not defined? or less likely UNAME_z_? > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:57 AM > Subject: Re: [Jprogramming] md5 is not md5 > > Here's what happens if I use that code and only extract hexhash from > the top (instead of simply incorporating both blocks of code): > >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |value error: sslSha256 > | sslSha256(y);(#y);md=.32#' ' > > So, ok, what's wrong with sslSha256? > >sslSha256 > |value error: sslSha256 >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl > |value error: OPENSSL > | (OPENSSL,m)&cd > > So, ok, what's wrong with OPENSSL? > >OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > <'libssl.dylib ') > |domain error > | OPENSSL=:sslp,(IFIOS+(;:'Win Linux Android > Darwin')i. ');(2$<'libssl.dylib ') > > In other words, I was just copying and pasting your code into > jconsole, rather than defining a script and attempting to debug it. > > I recall doing that earlier and finding an issue with libssl which I > was not prepared to deal with. > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 11:52 AM, 'Pascal Jasmin' via Programming > wrote: >> You did not go far enough down the page :P CryptAcquireContext is only used >> in the MSFT binding not openssl binding >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:49 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I used the code from the bottom of the page. >> >> Quite possibly I should have used it differently, but that's a different >> issue. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming >> wrote: >>> You are using the wrong code. That is indeed windows specific bindings. >>> The openssl bindings are at the bottom of the page. Though you may want to >>> pick up hexhash definition from the top section. >>> >>> >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 11:41 AM >>> Subject: Re: [Jprogramming] md5 is not md5 >>> >>> I tried your code at >>> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >>> >>>sha256 hexhash 'The quick brown fox jumps over the lazy dog' >>> |domain error: cd >>> | >>> CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT >>> >>> Meanwhile, what I have works for me. >>> >>> Specifically, I built libmd5.so using >>> https://github.com/rdm/libmd5.so, copied it into the directory >>> /home/ubuntu/bin/ and then used, from in J: >>> >>> md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) >>> md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' >>> >>> Now... since I need both 32 bit J (to parse xml using xml/sax - >>> apparently that only works on 32 bit j602) and 64 bit J (to deal with >>> more data than will fit in a 32 bit process), I'm having to have two >>> copies of libmd5.so - one for each instance of J. But I can live with >>> that. >>> >>> Thanks, >>> >>> -- >>> Raul >>> >>> >>> On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming >>> wrote: the code was tested at one point on mac. There is an attempt in the definitions (at bottom of page only) to link on linux. assumes /usr/lib/libssl.so . Should work? or few changes needed to work on linux? - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:11 AM Subject: Re: [Jprogramming] md5 is not md5 I can't use your implementation, since I'm not running this on windows. That said, I've got a fix for my code. That said, I do not have a fix for the portable code in convert/misc/md5. The first thing which would need to be fixed there are the uses of 32 b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but oddly enough that does not seem to be sufficient. It's not obvious to me what else needs to be fixed, and right now I am feeling too impatient to isolate the problem. Thanks, -- Raul On Sat, Sep 6, 2014 at 10:55 AM, 'Pascal Jasmin' via Programming wrote: > It was wri
Re: [Jprogramming] Ragged Array Shapes are Trees
Trees are an abstraction. Conceptually speaking all arrays - even non-ragged - can be thought of as trees. Whether they are very flat trees (only one level deep) or very tall and skinny trees (only one child at each node) or whether they are something else is not pre-determined. And that's the problem with trees - or the benefit - there are so many possibilities to choose from. It usually helps to have a problem you are interested in solving, to help you make reasonable choices from all those possibilities. With those cautions out of the way, here's a small exploration of a tree traversal in J: http://rosettacode.org/wiki/Tree_traversal#J Thanks, -- Raul On Sat, Sep 6, 2014 at 12:06 PM, Michal D. wrote: > I just came to the realization that ragged array shapes, regardless of how > you want to represent them, are trees. I would be interested in any > references to prior exploration of this idea. > > Some example data (boxes are used to display ragged arrays, but otherwise > have no semantic meaning): > >] A =. i. 2 3 > 0 1 2 > 3 4 5 >] B =. (< @ i."0) 1+i.2 > +-+---+ > |0|0 1| > +-+---+ >] C =. A ; B > +-+-+---+ > |0 1 2|0|0 1| > |3 4 5| | | > +-+-+---+ >] D =. A ; < B > +-+---+ > |0 1 2|+-+---+| > |3 4 5||0|0 1|| > | |+-+---+| > +-+---+ > > The corresponding shape trees (monospace font required, root node is on the > left): > > A: 2 - 3 > >1 > / > B: 2 > \ >2 > >2 - 3 > / > C: 3 - 1 > \ >2 > >2 - 3 > / > D: 2 1 > \ / >2 > \ >2 > > In some sense the shape tree for A is compressed, the verbose alternative > being: > >3 > / > A: 2 > \ >3 > > Compressing D in a similar manner leaves the full shape of the tree > ambiguous - there is no way to distinguish the duplicate structure of leaf > 3 from the structure of leaves 1, 2. > >3 > / > D: 2 - 2 - 1 > \ >2 > > We could resolving this ambiguity by listing the shapes of all the items > explicitly. The problem here is that 'compression' could very easily lead > to an increase in representation size, although it is nice and uniform for > ragged arrays of uniform rank. > > 3 > / > | 3 > | / > D: 2 - 2 + > | \ > | 1 > \ > 2 > > Regardless of compression, I would be interested in prior work in > representing shapes of ragged arrays as trees. > > Cheers, > > Mike > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] Ragged Array Shapes are Trees
Hi Michal, maybe this is an interesting representation for what you want? ([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1 ┌─┬─┐ │3│┌───┬─┬─┐│ │ ││2 3│1│2││ │ │└───┴─┴─┘│ └─┴─┘ - Original Message - From: Michal D. To: programm...@jsoftware.com Cc: Sent: Saturday, September 6, 2014 12:06 PM Subject: [Jprogramming] Ragged Array Shapes are Trees I just came to the realization that ragged array shapes, regardless of how you want to represent them, are trees. I would be interested in any references to prior exploration of this idea. Some example data (boxes are used to display ragged arrays, but otherwise have no semantic meaning): ] A =. i. 2 3 0 1 2 3 4 5 ] B =. (< @ i."0) 1+i.2 +-+---+ |0|0 1| +-+---+ ] C =. A ; B +-+-+---+ |0 1 2|0|0 1| |3 4 5| | | +-+-+---+ ] D =. A ; < B +-+---+ |0 1 2|+-+---+| |3 4 5||0|0 1|| | |+-+---+| +-+---+ The corresponding shape trees (monospace font required, root node is on the left): A: 2 - 3 1 / B: 2 \ 2 2 - 3 / C: 3 - 1 \ 2 2 - 3 / D: 2 1 \ / 2 \ 2 In some sense the shape tree for A is compressed, the verbose alternative being: 3 / A: 2 \ 3 Compressing D in a similar manner leaves the full shape of the tree ambiguous - there is no way to distinguish the duplicate structure of leaf 3 from the structure of leaves 1, 2. 3 / D: 2 - 2 - 1 \ 2 We could resolving this ambiguity by listing the shapes of all the items explicitly. The problem here is that 'compression' could very easily lead to an increase in representation size, although it is nice and uniform for ragged arrays of uniform rank. 3 / | 3 | / D: 2 - 2 + | \ | 1 \ 2 Regardless of compression, I would be interested in prior work in representing shapes of ragged arrays as trees. Cheers, Mike -- For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
sorry about domain error, fixed on wiki, changing line to: OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. To: Programming forum Cc: Sent: Saturday, September 6, 2014 12:12 PM Subject: Re: [Jprogramming] md5 is not md5 IFIOS 0 UNAME_z_ Linux sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' sslp /usr/lib/ Looking closer, I'm thinking you probably want /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so (which does not exist). That said, the domain error is because you are trying to compute this result: '/usr/lib/',2$<'libssl.so' Thanks, -- Raul On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming wrote: > what is sslp defined as? > > Is it possible IFIOS is not defined? or less likely UNAME_z_? > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 11:57 AM > Subject: Re: [Jprogramming] md5 is not md5 > > Here's what happens if I use that code and only extract hexhash from > the top (instead of simply incorporating both blocks of code): > >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |value error: sslSha256 > | sslSha256(y);(#y);md=.32#' ' > > So, ok, what's wrong with sslSha256? > >sslSha256 > |value error: sslSha256 >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl > |value error: OPENSSL > | (OPENSSL,m)&cd > > So, ok, what's wrong with OPENSSL? > >OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > <'libssl.dylib ') > |domain error > | OPENSSL=:sslp,(IFIOS+(;:'Win Linux Android > Darwin')i. ');(2$<'libssl.dylib ') > > In other words, I was just copying and pasting your code into > jconsole, rather than defining a script and attempting to debug it. > > I recall doing that earlier and finding an issue with libssl which I > was not prepared to deal with. > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 11:52 AM, 'Pascal Jasmin' via Programming > wrote: >> You did not go far enough down the page :P CryptAcquireContext is only used >> in the MSFT binding not openssl binding >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:49 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> I used the code from the bottom of the page. >> >> Quite possibly I should have used it differently, but that's a different >> issue. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming >> wrote: >>> You are using the wrong code. That is indeed windows specific bindings. >>> The openssl bindings are at the bottom of the page. Though you may want to >>> pick up hexhash definition from the top section. >>> >>> >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 11:41 AM >>> Subject: Re: [Jprogramming] md5 is not md5 >>> >>> I tried your code at >>> http://www.jsoftware.com/jwiki/PascalJasmin/SHA%201%2C%202%20and%20MD5%20for%20windows >>> >>>sha256 hexhash 'The quick brown fox jumps over the lazy dog' >>> |domain error: cd >>> | >>> CryptAcquireContext(aProv=.,_1);(<0);(<0);PROV_RSA_AES;CRYPT_VERIFYCONTEXT >>> >>> Meanwhile, what I have works for me. >>> >>> Specifically, I built libmd5.so using >>> https://github.com/rdm/libmd5.so, copied it into the directory >>> /home/ubuntu/bin/ and then used, from in J: >>> >>> md5raw=: '/home/ubuntu/bin/libmd5-64.so MD5String > l *c l'&(15!:0)@(; #) >>> md5=: 3 :',tolower hfd a.i. 15!:1 (md5raw y),0 16 2' >>> >>> Now... since I need both 32 bit J (to parse xml using xml/sax - >>> apparently that only works on 32 bit j602) and 64 bit J (to deal with >>> more data than will fit in a 32 bit process), I'm having to have two >>> copies of libmd5.so - one for each instance of J. But I can live with >>> that. >>> >>> Thanks, >>> >>> -- >>> Raul >>> >>> >>> On Sat, Sep 6, 2014 at 11:23 AM, 'Pascal Jasmin' via Programming >>> wrote: the code was tested at one point on mac. There is an attempt in the definitions (at bottom of page only) to link on linux. assumes /usr/lib/libssl.so . Should work? or few changes needed to work on linux? - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:11 AM Subject: Re: [Jprogramming] md5 is not md5 I can't use your implementation, since I'm not running this on windows. That said, I've got a fix for my code. That said, I do not have a fix for the portable code in convert/misc/md5. The first thing which would need to be fixed there are the uses of 32 b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but oddly enough that does not seem to be sufficient. It's not obvious to me what else n
Re: [Jprogramming] md5 is not md5
I haven't tested this on J64, but something like removeupper =: (_1 xor 32 (33 b.) _1)&and rot =: (removeupper or _32&(33 b.))@:(32 b.) sh =: removeupper&(33 b.) will work on J32 and J64, but you would need to apply removeupper also to the negative constants: T and q Henry Rich On 9/6/2014 11:11 AM, Raul Miller wrote: I can't use your implementation, since I'm not running this on windows. That said, I've got a fix for my code. That said, I do not have a fix for the portable code in convert/misc/md5. The first thing which would need to be fixed there are the uses of 32 b. and 33 b. (in the definitions of sh_pcrypt_ and rot_pcrypt_) but oddly enough that does not seem to be sufficient. It's not obvious to me what else needs to be fixed, and right now I am feeling too impatient to isolate the problem. Thanks, -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
This works on that machine: OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x *c') ssl NB. SHA256 i *c l *c' ssl s256=: 3 : 0 sslSha256 (y);(#y);md=. 32#' ' md ) hexhash =: ( [: ,@:hfd a.i.])@: s256 hexhash 'The quick brown fox jumps over the lazy dog' d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 However, if I try OPENSSL=:'libssl.so' sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x *c') ssl NB. SHA256 i *c l *c' ssl s256 hexhash 'The quick brown fox jumps over the lazy dog' |domain error: cd Similarly: OPENSSL=:'/usr/lib/libssl.so' sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x *c') ssl NB. SHA256 i *c l *c' ssl s256 hexhash 'The quick brown fox jumps over the lazy dog' |domain error: cd Speaking more generally, the motivation behind having the very specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit code and the 32 bit code can coexist, and the reason for not supporting the more generic /usr/lib/libssl.so is so that there's a clean separation between these two mechanisms. It's a bit ugly, but so is the underlying cpu architecture. Thanks, -- Raul On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming wrote: > sorry about domain error, fixed on wiki, changing line to: > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. 'libeay32.dll '; (2 $ <'libssl.so '), (2 $ <'libssl.dylib ') > > basically, OPENSSL should be set to: (based on your distribution) > >OPENSSL > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > > my understanding of linux is that libssl.so will find the latest version. > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what you want > assigned in the sslp =: line. Perhaps you want to also add an IF64 line for > your other system > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 12:12 PM > Subject: Re: [Jprogramming] md5 is not md5 > >IFIOS > 0 >UNAME_z_ > Linux >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' >sslp > /usr/lib/ > > Looking closer, I'm thinking you probably want > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so > (which does not exist). > > That said, the domain error is because you are trying to compute this result: > >'/usr/lib/',2$<'libssl.so' > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming > wrote: >> what is sslp defined as? >> >> Is it possible IFIOS is not defined? or less likely UNAME_z_? >> >> >> - Original Message - >> From: Raul Miller >> To: Programming forum >> Cc: >> Sent: Saturday, September 6, 2014 11:57 AM >> Subject: Re: [Jprogramming] md5 is not md5 >> >> Here's what happens if I use that code and only extract hexhash from >> the top (instead of simply incorporating both blocks of code): >> >>s256 hexhash 'The quick brown fox jumps over the lazy dog' >> |value error: sslSha256 >> | sslSha256(y);(#y);md=.32#' ' >> >> So, ok, what's wrong with sslSha256? >> >>sslSha256 >> |value error: sslSha256 >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x >> *c') ssl NB. SHA256 i *c l *c' ssl >> |value error: OPENSSL >> | (OPENSSL,m)&cd >> >> So, ok, what's wrong with OPENSSL? >> >>OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. >> > <'libssl.dylib ') >> |domain error >> | OPENSSL=:sslp,(IFIOS+(;:'Win Linux Android >> Darwin')i.> ');(2$<'libssl.dylib ') >> >> In other words, I was just copying and pasting your code into >> jconsole, rather than defining a script and attempting to debug it. >> >> I recall doing that earlier and finding an issue with libssl which I >> was not prepared to deal with. >> >> Thanks, >> >> -- >> Raul >> >> On Sat, Sep 6, 2014 at 11:52 AM, 'Pascal Jasmin' via Programming >> wrote: >>> You did not go far enough down the page :P CryptAcquireContext is only >>> used in the MSFT binding not openssl binding >>> >>> >>> - Original Message - >>> From: Raul Miller >>> To: Programming forum >>> Cc: >>> Sent: Saturday, September 6, 2014 11:49 AM >>> Subject: Re: [Jprogramming] md5 is not md5 >>> >>> I used the code from the bottom of the page. >>> >>> Quite possibly I should have used it differently, but that's a different >>> issue. >>> >>> Thanks, >>> >>> -- >>> Raul >>> >>> >>> On Sat, Sep 6, 2014 at 11:46 AM, 'Pascal Jasmin' via Programming >>> wrote: You are using the wrong code. That is indeed windows specific bindings. The openssl bindings are at the bottom of the page. Though you may want to pick up hexhash definition from the top section. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Saturday, September 6, 2014 11:41 AM Subject: Re: [Jprogramming] md5 i
Re: [Jprogramming] md5 is not md5
This is multi-arch. if we just use the bare file name, OPENSSL=: 'libssl.so.1.0.0' it will work on 32-bit and 64-bit, and also works for 32-bit process on 64-bit host. should also works on raspi even the prefix would be /lib/arm-linux-gnueabihf/ all J8 addons use this scheme for shared objects. Сб, 06 сен 2014, Raul Miller написал(а): > This works on that machine: > >OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256=: 3 : 0 > sslSha256 (y);(#y);md=. 32#' ' > md >) >hexhash =: ( [: ,@:hfd a.i.])@: > >s256 hexhash 'The quick brown fox jumps over the lazy dog' > d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 > > However, if I try >OPENSSL=:'libssl.so' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > > Similarly: >OPENSSL=:'/usr/lib/libssl.so' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > > Speaking more generally, the motivation behind having the very > specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit > code and the 32 bit code can coexist, and the reason for not > supporting the more generic /usr/lib/libssl.so is so that there's a > clean separation between these two mechanisms. It's a bit ugly, but so > is the underlying cpu architecture. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming > wrote: > > sorry about domain error, fixed on wiki, changing line to: > > > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > pick 'libeay32.dll '; (2 $ <'libssl.so '), (2 $ <'libssl.dylib ') > > > > basically, OPENSSL should be set to: (based on your distribution) > > > >OPENSSL > > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > > > > my understanding of linux is that libssl.so will find the latest version. > > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what you want > > assigned in the sslp =: line. Perhaps you want to also add an IF64 line > > for your other system > > > > > > - Original Message - > > From: Raul Miller > > To: Programming forum > > Cc: > > Sent: Saturday, September 6, 2014 12:12 PM > > Subject: Re: [Jprogramming] md5 is not md5 > > > >IFIOS > > 0 > >UNAME_z_ > > Linux > >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' > >sslp > > /usr/lib/ > > > > Looking closer, I'm thinking you probably want > > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so > > (which does not exist). > > > > That said, the domain error is because you are trying to compute this > > result: > > > >'/usr/lib/',2$<'libssl.so' > > > > Thanks, > > > > -- > > Raul > > > > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming > > wrote: > >> what is sslp defined as? > >> > >> Is it possible IFIOS is not defined? or less likely UNAME_z_? > >> > >> > >> - Original Message - > >> From: Raul Miller > >> To: Programming forum > >> Cc: > >> Sent: Saturday, September 6, 2014 11:57 AM > >> Subject: Re: [Jprogramming] md5 is not md5 > >> > >> Here's what happens if I use that code and only extract hexhash from > >> the top (instead of simply incorporating both blocks of code): > >> > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |value error: sslSha256 > >> | sslSha256(y);(#y);md=.32#' ' > >> > >> So, ok, what's wrong with sslSha256? > >> > >>sslSha256 > >> |value error: sslSha256 > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >> |value error: OPENSSL > >> | (OPENSSL,m)&cd > >> > >> So, ok, what's wrong with OPENSSL? > >> > >>OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > >> >> <'libssl.dylib ') > >> |domain error > >> | OPENSSL=:sslp,(IFIOS+(;:'Win Linux Android > >> Darwin')i. >> ');(2$<'libssl.dylib ') > >> > >> In other words, I was just copying and pasting your code into > >> jconsole, rather than defining a script and attempting to debug it. > >> > >> I recall doing that earlier and finding an issue with libssl which I > >> was not prepared to deal with. > >> > >> Thanks, > >> > >> -- > >> Raul > >> > >> On Sat, Sep 6, 2014 at 11:52 AM, 'Pascal Jasmin' via Programming > >> wrote: > >>> You did not go far enough down the page :P CryptAcquireContext is only > >>> used in the MSFT binding not openssl binding > >>> > >>> > >>> - Original Message - > >>> From: Raul Miller > >>> To: Programming forum > >>> Cc: > >>> Sent: Saturday, September 6, 2014 11:49 AM > >>> Subject: Re: [Jprogramming] md5 is not md5 > >>> > >>> I used the code from the
Re: [Jprogramming] md5 is not md5
with that info, I've changed 2 lines on wiki: sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this line if you wish to point to downloaded folder OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. To: programm...@jsoftware.com Cc: Sent: Saturday, September 6, 2014 1:44 PM Subject: Re: [Jprogramming] md5 is not md5 This is multi-arch. if we just use the bare file name, OPENSSL=: 'libssl.so.1.0.0' it will work on 32-bit and 64-bit, and also works for 32-bit process on 64-bit host. should also works on raspi even the prefix would be /lib/arm-linux-gnueabihf/ all J8 addons use this scheme for shared objects. Сб, 06 сен 2014, Raul Miller написал(а): > This works on that machine: > >OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256=: 3 : 0 > sslSha256 (y);(#y);md=. 32#' ' > md >) >hexhash =: ( [: ,@:hfd a.i.])@: > >s256 hexhash 'The quick brown fox jumps over the lazy dog' > d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 > > However, if I try >OPENSSL=:'libssl.so' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > > Similarly: >OPENSSL=:'/usr/lib/libssl.so' >sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > *c') ssl NB. SHA256 i *c l *c' ssl >s256 hexhash 'The quick brown fox jumps over the lazy dog' > |domain error: cd > > Speaking more generally, the motivation behind having the very > specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit > code and the 32 bit code can coexist, and the reason for not > supporting the more generic /usr/lib/libssl.so is so that there's a > clean separation between these two mechanisms. It's a bit ugly, but so > is the underlying cpu architecture. > > Thanks, > > -- > Raul > > > On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming > wrote: > > sorry about domain error, fixed on wiki, changing line to: > > > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > pick 'libeay32.dll '; (2 $ <'libssl.so '), (2 $ <'libssl.dylib ') > > > > basically, OPENSSL should be set to: (based on your distribution) > > > >OPENSSL > > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > > > > my understanding of linux is that libssl.so will find the latest version. > > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what you want > > assigned in the sslp =: line. Perhaps you want to also add an IF64 line > > for your other system > > > > > > - Original Message - > > From: Raul Miller > > To: Programming forum > > Cc: > > Sent: Saturday, September 6, 2014 12:12 PM > > Subject: Re: [Jprogramming] md5 is not md5 > > > >IFIOS > > 0 > >UNAME_z_ > > Linux > >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' > >sslp > > /usr/lib/ > > > > Looking closer, I'm thinking you probably want > > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so > > (which does not exist). > > > > That said, the domain error is because you are trying to compute this > > result: > > > >'/usr/lib/',2$<'libssl.so' > > > > Thanks, > > > > -- > > Raul > > > > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming > > wrote: > >> what is sslp defined as? > >> > >> Is it possible IFIOS is not defined? or less likely UNAME_z_? > >> > >> > >> - Original Message - > >> From: Raul Miller > >> To: Programming forum > >> Cc: > >> Sent: Saturday, September 6, 2014 11:57 AM > >> Subject: Re: [Jprogramming] md5 is not md5 > >> > >> Here's what happens if I use that code and only extract hexhash from > >> the top (instead of simply incorporating both blocks of code): > >> > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |value error: sslSha256 > >> | sslSha256(y);(#y);md=.32#' ' > >> > >> So, ok, what's wrong with sslSha256? > >> > >>sslSha256 > >> |value error: sslSha256 > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >> |value error: OPENSSL > >> | (OPENSSL,m)&cd > >> > >> So, ok, what's wrong with OPENSSL? > >> > >>OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > >> >> <'libssl.dylib ') > >> |domain error > >> | OPENSSL=:sslp,(IFIOS+(;:'Win Linux Android > >> Darwin')i. >> ');(2$<'libssl.dylib ') > >> > >> In other words, I was just copying and pasting your code into > >> jconsole, rather than defining a script and attempting to debug it. > >> > >> I recall doing that earlier and finding an issue with libssl which I > >> was not prepared to deal with. > >> > >> Thanks, > >> > >> -- > >> Raul > >> > >> On Sat, Sep 6, 2014 at 11:52 AM, 'Pascal Jasmin' via Programming > >> wrote: > >>> You did not go far en
Re: [Jprogramming] Ragged Array Shapes are Trees
Trees and arrays and simple variables and databases may be represented by ordinal fractions, see http://www.statemaster.com/encyclopedia/Ordinal-fraction. That is my favorite representation of data. Thanks. Bo. Den 18:28 lørdag den 6. september 2014 skrev 'Pascal Jasmin' via Programming : > > >Hi Michal, > >maybe this is an interesting representation for what you want? > > ([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1 >┌─┬─┐ >│3│┌───┬─┬─┐│ >│ ││2 3│1│2││ >│ │└───┴─┴─┘│ >└─┴─┘ > > > >- Original Message - >From: Michal D. >To: programm...@jsoftware.com >Cc: >Sent: Saturday, September 6, 2014 12:06 PM >Subject: [Jprogramming] Ragged Array Shapes are Trees > >I just came to the realization that ragged array shapes, regardless of how >you want to represent them, are trees. I would be interested in any >references to prior exploration of this idea. > >Some example data (boxes are used to display ragged arrays, but otherwise >have no semantic meaning): > > ] A =. i. 2 3 >0 1 2 >3 4 5 > ] B =. (< @ i."0) 1+i.2 >+-+---+ >|0|0 1| >+-+---+ > ] C =. A ; B >+-+-+---+ >|0 1 2|0|0 1| >|3 4 5| | | >+-+-+---+ > ] D =. A ; < B >+-+---+ >|0 1 2|+-+---+| >|3 4 5||0|0 1|| >| |+-+---+| >+-+---+ > >The corresponding shape trees (monospace font required, root node is on the >left): > >A: 2 - 3 > > 1 > / >B: 2 > \ > 2 > > 2 - 3 > / >C: 3 - 1 > \ > 2 > > 2 - 3 > / >D: 2 1 > \ / > 2 > \ > 2 > >In some sense the shape tree for A is compressed, the verbose alternative >being: > > 3 > / >A: 2 > \ > 3 > >Compressing D in a similar manner leaves the full shape of the tree >ambiguous - there is no way to distinguish the duplicate structure of leaf >3 from the structure of leaves 1, 2. > > 3 > / >D: 2 - 2 - 1 > \ > 2 > >We could resolving this ambiguity by listing the shapes of all the items >explicitly. The problem here is that 'compression' could very easily lead >to an increase in representation size, although it is nice and uniform for >ragged arrays of uniform rank. > >3 > / > | 3 > | / >D: 2 - 2 + > | \ > | 1 > \ >2 > >Regardless of compression, I would be interested in prior work in >representing shapes of ragged arrays as trees. > >Cheers, > >Mike >-- >For information about J forums see http://www.jsoftware.com/forums.htm > > >-- >For information about J forums see http://www.jsoftware.com/forums.htm > > -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jprogramming] md5 is not md5
sslp should be empty, except for windows. (Actually, that could be expressed more simply but hopefully it's clear enough this way?) Thanks, -- Raul On Sat, Sep 6, 2014 at 1:55 PM, 'Pascal Jasmin' via Programming wrote: > with that info, I've changed 2 lines on wiki: > sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this line if > you wish to point to downloaded folder > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. 'libeay32.dll '; (2 $ <'libssl.so.1.0.0 '), (2 $ <'/usr/lib/libssl.dylib ') > > > > - Original Message - > From: bill lam > To: programm...@jsoftware.com > Cc: > Sent: Saturday, September 6, 2014 1:44 PM > Subject: Re: [Jprogramming] md5 is not md5 > > This is multi-arch. if we just use the bare file name, > > OPENSSL=: 'libssl.so.1.0.0' > > it will work on 32-bit and 64-bit, and also > works for 32-bit process on 64-bit host. > > should also works on raspi even the prefix would be > /lib/arm-linux-gnueabihf/ > > all J8 addons use this scheme for shared objects. > > Сб, 06 сен 2014, Raul Miller написал(а): >> This works on that machine: >> >>OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x >> *c') ssl NB. SHA256 i *c l *c' ssl >>s256=: 3 : 0 >> sslSha256 (y);(#y);md=. 32#' ' >> md >>) >>hexhash =: ( [: ,@:hfd a.i.])@: >> >>s256 hexhash 'The quick brown fox jumps over the lazy dog' >> d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 >> >> However, if I try >>OPENSSL=:'libssl.so' >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x >> *c') ssl NB. SHA256 i *c l *c' ssl >>s256 hexhash 'The quick brown fox jumps over the lazy dog' >> |domain error: cd >> >> Similarly: >>OPENSSL=:'/usr/lib/libssl.so' >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x >> *c') ssl NB. SHA256 i *c l *c' ssl >>s256 hexhash 'The quick brown fox jumps over the lazy dog' >> |domain error: cd >> >> Speaking more generally, the motivation behind having the very >> specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit >> code and the 32 bit code can coexist, and the reason for not >> supporting the more generic /usr/lib/libssl.so is so that there's a >> clean separation between these two mechanisms. It's a bit ugly, but so >> is the underlying cpu architecture. >> >> Thanks, >> >> -- >> Raul >> >> >> On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming >> wrote: >> > sorry about domain error, fixed on wiki, changing line to: >> > >> > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > > pick 'libeay32.dll '; (2 $ <'libssl.so '), (2 $ <'libssl.dylib ') >> > >> > basically, OPENSSL should be set to: (based on your distribution) >> > >> >OPENSSL >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 >> > >> > my understanding of linux is that libssl.so will find the latest version. >> > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what you >> > want assigned in the sslp =: line. Perhaps you want to also add an IF64 >> > line for your other system >> > >> > >> > - Original Message - >> > From: Raul Miller >> > To: Programming forum >> > Cc: >> > Sent: Saturday, September 6, 2014 12:12 PM >> > Subject: Re: [Jprogramming] md5 is not md5 >> > >> >IFIOS >> > 0 >> >UNAME_z_ >> > Linux >> >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' >> >sslp >> > /usr/lib/ >> > >> > Looking closer, I'm thinking you probably want >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so >> > (which does not exist). >> > >> > That said, the domain error is because you are trying to compute this >> > result: >> > >> >'/usr/lib/',2$<'libssl.so' >> > >> > Thanks, >> > >> > -- >> > Raul >> > >> > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming >> > wrote: >> >> what is sslp defined as? >> >> >> >> Is it possible IFIOS is not defined? or less likely UNAME_z_? >> >> >> >> >> >> - Original Message - >> >> From: Raul Miller >> >> To: Programming forum >> >> Cc: >> >> Sent: Saturday, September 6, 2014 11:57 AM >> >> Subject: Re: [Jprogramming] md5 is not md5 >> >> >> >> Here's what happens if I use that code and only extract hexhash from >> >> the top (instead of simply incorporating both blocks of code): >> >> >> >>s256 hexhash 'The quick brown fox jumps over the lazy dog' >> >> |value error: sslSha256 >> >> | sslSha256(y);(#y);md=.32#' ' >> >> >> >> So, ok, what's wrong with sslSha256? >> >> >> >>sslSha256 >> >> |value error: sslSha256 >> >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x >> >> *c') ssl NB. SHA256 i *c l *c' ssl >> >> |value error: OPENSSL >> >> | (OPENSSL,m)&cd >> >> >> >> So, ok, what's wrong with OPENSSL? >> >> >> >>OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. >> >> > >> <'libssl.dylib ') >> >> |domain error >> >> |
Re: [Jprogramming] md5 is not md5
sslp should be redundant because ~bin where the exe for the windows process started will automatically in the dll search path. I think libssl is not a stable api for android. Its path is tricky to specified even if it is part of the Qt lib runtime. shared objects in android normally do not have version suffix. On Sep 7, 2014 6:19 AM, "Raul Miller" wrote: > sslp should be empty, except for windows. > > (Actually, that could be expressed more simply but hopefully it's > clear enough this way?) > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 1:55 PM, 'Pascal Jasmin' via Programming > wrote: > > with that info, I've changed 2 lines on wiki: > > sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this line > if you wish to point to downloaded folder > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. pick 'libeay32.dll '; (2 $ <'libssl.so.1.0.0 '), (2 $ > <'/usr/lib/libssl.dylib ') > > > > > > > > - Original Message - > > From: bill lam > > To: programm...@jsoftware.com > > Cc: > > Sent: Saturday, September 6, 2014 1:44 PM > > Subject: Re: [Jprogramming] md5 is not md5 > > > > This is multi-arch. if we just use the bare file name, > > > > OPENSSL=: 'libssl.so.1.0.0' > > > > it will work on 32-bit and 64-bit, and also > > works for 32-bit process on 64-bit host. > > > > should also works on raspi even the prefix would be > > /lib/arm-linux-gnueabihf/ > > > > all J8 addons use this scheme for shared objects. > > > > Сб, 06 сен 2014, Raul Miller написал(а): > >> This works on that machine: > >> > >>OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256=: 3 : 0 > >> sslSha256 (y);(#y);md=. 32#' ' > >> md > >>) > >>hexhash =: ( [: ,@:hfd a.i.])@: > >> > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 > >> > >> However, if I try > >>OPENSSL=:'libssl.so' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |domain error: cd > >> > >> Similarly: > >>OPENSSL=:'/usr/lib/libssl.so' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |domain error: cd > >> > >> Speaking more generally, the motivation behind having the very > >> specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit > >> code and the 32 bit code can coexist, and the reason for not > >> supporting the more generic /usr/lib/libssl.so is so that there's a > >> clean separation between these two mechanisms. It's a bit ugly, but so > >> is the underlying cpu architecture. > >> > >> Thanks, > >> > >> -- > >> Raul > >> > >> > >> On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming > >> wrote: > >> > sorry about domain error, fixed on wiki, changing line to: > >> > > >> > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > ') > >> > > >> > basically, OPENSSL should be set to: (based on your distribution) > >> > > >> >OPENSSL > >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > >> > > >> > my understanding of linux is that libssl.so will find the latest > version. > >> > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what > you want assigned in the sslp =: line. Perhaps you want to also add an > IF64 line for your other system > >> > > >> > > >> > - Original Message - > >> > From: Raul Miller > >> > To: Programming forum > >> > Cc: > >> > Sent: Saturday, September 6, 2014 12:12 PM > >> > Subject: Re: [Jprogramming] md5 is not md5 > >> > > >> >IFIOS > >> > 0 > >> >UNAME_z_ > >> > Linux > >> >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' > >> >sslp > >> > /usr/lib/ > >> > > >> > Looking closer, I'm thinking you probably want > >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so > >> > (which does not exist). > >> > > >> > That said, the domain error is because you are trying to compute this > result: > >> > > >> >'/usr/lib/',2$<'libssl.so' > >> > > >> > Thanks, > >> > > >> > -- > >> > Raul > >> > > >> > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming > >> > wrote: > >> >> what is sslp defined as? > >> >> > >> >> Is it possible IFIOS is not defined? or less likely UNAME_z_? > >> >> > >> >> > >> >> - Original Message - > >> >> From: Raul Miller > >> >> To: Programming forum > >> >> Cc: > >> >> Sent: Saturday, September 6, 2014 11:57 AM > >> >> Subject: Re: [Jprogramming] md5 is not md5 > >> >> > >> >> Here's what happens if I use that code and only extract hexhash from > >> >> the top (instead of simply incorporating both blocks of code): > >> >> > >> >>s256 hexhash 'The quick b
Re: [Jprogramming] md5 is not md5
It was developed prior to j802, and so providing a hard path option seems still useful for other J versions on windows. on adroid, would this be the best result? OPENSSL=: 'libssl.so' - Original Message - From: bill lam To: Programming forum Cc: Sent: Saturday, September 6, 2014 8:15 PM Subject: Re: [Jprogramming] md5 is not md5 sslp should be redundant because ~bin where the exe for the windows process started will automatically in the dll search path. I think libssl is not a stable api for android. Its path is tricky to specified even if it is part of the Qt lib runtime. shared objects in android normally do not have version suffix. On Sep 7, 2014 6:19 AM, "Raul Miller" wrote: > sslp should be empty, except for windows. > > (Actually, that could be expressed more simply but hopefully it's > clear enough this way?) > > Thanks, > > -- > Raul > > On Sat, Sep 6, 2014 at 1:55 PM, 'Pascal Jasmin' via Programming > wrote: > > with that info, I've changed 2 lines on wiki: > > sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this line > if you wish to point to downloaded folder > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. pick 'libeay32.dll '; (2 $ <'libssl.so.1.0.0 '), (2 $ > <'/usr/lib/libssl.dylib ') > > > > > > > > - Original Message - > > From: bill lam > > To: programm...@jsoftware.com > > Cc: > > Sent: Saturday, September 6, 2014 1:44 PM > > Subject: Re: [Jprogramming] md5 is not md5 > > > > This is multi-arch. if we just use the bare file name, > > > > OPENSSL=: 'libssl.so.1.0.0' > > > > it will work on 32-bit and 64-bit, and also > > works for 32-bit process on 64-bit host. > > > > should also works on raspi even the prefix would be > > /lib/arm-linux-gnueabihf/ > > > > all J8 addons use this scheme for shared objects. > > > > Сб, 06 сен 2014, Raul Miller написал(а): > >> This works on that machine: > >> > >>OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256=: 3 : 0 > >> sslSha256 (y);(#y);md=. 32#' ' > >> md > >>) > >>hexhash =: ( [: ,@:hfd a.i.])@: > >> > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 > >> > >> However, if I try > >>OPENSSL=:'libssl.so' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |domain error: cd > >> > >> Similarly: > >>OPENSSL=:'/usr/lib/libssl.so' > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > >> *c') ssl NB. SHA256 i *c l *c' ssl > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > >> |domain error: cd > >> > >> Speaking more generally, the motivation behind having the very > >> specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit > >> code and the 32 bit code can coexist, and the reason for not > >> supporting the more generic /usr/lib/libssl.so is so that there's a > >> clean separation between these two mechanisms. It's a bit ugly, but so > >> is the underlying cpu architecture. > >> > >> Thanks, > >> > >> -- > >> Raul > >> > >> > >> On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming > >> wrote: > >> > sorry about domain error, fixed on wiki, changing line to: > >> > > >> > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > ') > >> > > >> > basically, OPENSSL should be set to: (based on your distribution) > >> > > >> >OPENSSL > >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > >> > > >> > my understanding of linux is that libssl.so will find the latest > version. > >> > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what > you want assigned in the sslp =: line. Perhaps you want to also add an > IF64 line for your other system > >> > > >> > > >> > - Original Message - > >> > From: Raul Miller > >> > To: Programming forum > >> > Cc: > >> > Sent: Saturday, September 6, 2014 12:12 PM > >> > Subject: Re: [Jprogramming] md5 is not md5 > >> > > >> >IFIOS > >> > 0 > >> >UNAME_z_ > >> > Linux > >> >sslp =: IFWIN pick '/usr/lib/';'D:\OpenSSL-Win64\bin\' > >> >sslp > >> > /usr/lib/ > >> > > >> > Looking closer, I'm thinking you probably want > >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 rather than /usr/lib/libssl.so > >> > (which does not exist). > >> > > >> > That said, the domain error is because you are trying to compute this > result: > >> > > >> >'/usr/lib/',2$<'libssl.so' > >> > > >> > Thanks, > >> > > >> > -- > >> > Raul > >> > > >> > On Sat, Sep 6, 2014 at 12:02 PM, 'Pascal Jasmin' via Programming > >> > wrote: > >> >> what is sslp defined as? > >> >> > >> >> Is it possible IFIOS is not defined? or less likely UNAME_z_? > >> >> > >> >> > >> >> - Original Message - > >> >> From: Raul Mille
Re: [Jprogramming] md5 is not md5
this is fine but libssl.so is not part of android system library or Qt5 runtime for android. If you really want it, you need to copy libssl.so under j install folder inside /data/data and set a explicit path to access that libssl. You may take a look on the lapack addon for android which use an android version of lapack shared object. On Sep 7, 2014 8:29 AM, "'Pascal Jasmin' via Programming" < programm...@jsoftware.com> wrote: > It was developed prior to j802, and so providing a hard path option seems > still useful for other J versions on windows. > > on adroid, would this be the best result? > > OPENSSL=: 'libssl.so' > > > - Original Message - > From: bill lam > To: Programming forum > Cc: > Sent: Saturday, September 6, 2014 8:15 PM > Subject: Re: [Jprogramming] md5 is not md5 > > sslp should be redundant because ~bin where the exe for the windows process > started will automatically in the dll search path. > > I think libssl is not a stable api for android. Its path is tricky to > specified even if it is part of the Qt lib runtime. shared objects in > android normally do not have version suffix. > On Sep 7, 2014 6:19 AM, "Raul Miller" wrote: > > > sslp should be empty, except for windows. > > > > (Actually, that could be expressed more simply but hopefully it's > > clear enough this way?) > > > > Thanks, > > > > -- > > Raul > > > > On Sat, Sep 6, 2014 at 1:55 PM, 'Pascal Jasmin' via Programming > > wrote: > > > with that info, I've changed 2 lines on wiki: > > > sslp =: IFWIN pick ''; '/',~ jpath '~bin' NB. with J802. cut this > line > > if you wish to point to downloaded folder > > > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > > pick 'libeay32.dll '; (2 $ <'libssl.so.1.0.0 '), (2 $ > > <'/usr/lib/libssl.dylib ') > > > > > > > > > > > > - Original Message - > > > From: bill lam > > > To: programm...@jsoftware.com > > > Cc: > > > Sent: Saturday, September 6, 2014 1:44 PM > > > Subject: Re: [Jprogramming] md5 is not md5 > > > > > > This is multi-arch. if we just use the bare file name, > > > > > > OPENSSL=: 'libssl.so.1.0.0' > > > > > > it will work on 32-bit and 64-bit, and also > > > works for 32-bit process on 64-bit host. > > > > > > should also works on raspi even the prefix would be > > > /lib/arm-linux-gnueabihf/ > > > > > > all J8 addons use this scheme for shared objects. > > > > > > Сб, 06 сен 2014, Raul Miller написал(а): > > >> This works on that machine: > > >> > > >>OPENSSL=: '/lib/x86_64-linux-gnu/libssl.so.1.0.0' > > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > > >> *c') ssl NB. SHA256 i *c l *c' ssl > > >>s256=: 3 : 0 > > >> sslSha256 (y);(#y);md=. 32#' ' > > >> md > > >>) > > >>hexhash =: ( [: ,@:hfd a.i.])@: > > >> > > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > > >> d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 > > >> > > >> However, if I try > > >>OPENSSL=:'libssl.so' > > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > > >> *c') ssl NB. SHA256 i *c l *c' ssl > > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > > >> |domain error: cd > > >> > > >> Similarly: > > >>OPENSSL=:'/usr/lib/libssl.so' > > >>sslSha256 =: (IFWIN {:: ' SHA256 > + x *c x *c';'SHA256 > x *c x > > >> *c') ssl NB. SHA256 i *c l *c' ssl > > >>s256 hexhash 'The quick brown fox jumps over the lazy dog' > > >> |domain error: cd > > >> > > >> Speaking more generally, the motivation behind having the very > > >> specific /lib/x86_64-linux-gnu/libssl.so.1.0.0 is so that the 64 bit > > >> code and the 32 bit code can coexist, and the reason for not > > >> supporting the more generic /usr/lib/libssl.so is so that there's a > > >> clean separation between these two mechanisms. It's a bit ugly, but so > > >> is the underlying cpu architecture. > > >> > > >> Thanks, > > >> > > >> -- > > >> Raul > > >> > > >> > > >> On Sat, Sep 6, 2014 at 12:49 PM, 'Pascal Jasmin' via Programming > > >> wrote: > > >> > sorry about domain error, fixed on wiki, changing line to: > > >> > > > >> > OPENSSL =: sslp , (IFIOS + (;: 'Win Linux Android Darwin') i. > > <'libssl.dylib > > ') > > >> > > > >> > basically, OPENSSL should be set to: (based on your distribution) > > >> > > > >> >OPENSSL > > >> > /lib/x86_64-linux-gnu/libssl.so.1.0.0 > > >> > > > >> > my understanding of linux is that libssl.so will find the latest > > version. > > >> > No idea how standard '/lib/x86_64-linux-gnu/' is, but that is what > > you want assigned in the sslp =: line. Perhaps you want to also add an > > IF64 line for your other system > > >> > > > >> > > > >> > - Original Message - > > >> > From: Raul Miller > > >> > To: Programming forum > > >> > Cc: > > >> > Sent: Saturday, September 6, 2014 12:12 PM > > >> > Subject: Re: [Jprogramming] md5 is not md5 > > >> > > > >> >IFIOS > > >> > 0 > > >> >UNAME_z_ > > >> > Linux > > >> >sslp =: