libsodium on LiveCode?
monte at appisle.net
Mon Feb 19 17:09:11 EST 2018
It probably depends on how these are used as to what you want here, however, if all of these are data coming from LCS then I’d suggest you want your LCB handlers to take in Data and then use something like:
__safe foreign handler MCDataGetBytePtr(in pData as Data) returns Pointer binds to "<builtin>”
__safe foreign handler MCDataGetLength(in pData as Data) returns LCUIndex binds to "<builtin>"
public handler DoSomething(in pPK as Data)
if MCDataGetLength(pPK) is not 32 then
throw “PK not 32 bytes"
variable tPK as Pointer
put MCDataGetBytePtr(pPK) into tPK
> On 19 Feb 2018, at 5:11 pm, Brian Milby via use-livecode <use-livecode at lists.runrev.com> wrote:
> Looks like most of the functions use OpenSSL.
> Started looking at the headers and there are over 650 function calls in
> libsodium. Got bogged down pretty fast though.
> Trying to look at some type mappings and am a little confused on how to do
> the following:
> unsigned char *pk
> const unsigned char *seed
> unsigned char pk
> const unsigned char seed
> I know that the const means that it will be in only and the others are
> either inout or out. I’m really hoping that we don’t need to use
> “MCAggregateTypeInfo” followed by 32 “c” characters. (They don’t use
> numbers in the headers but rather #define values).
> On Sun, Feb 18, 2018 at 11:02 AM Mark Wieder via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>> On 02/17/2018 10:53 AM, Brian Milby via use-livecode wrote:
>>> I found a thread from a year ago that mentions libsodium:
>>> I was wondering if anyone had taken a look at what it would take to build
>>> something usable within LiveCode? My guess is that this is something
>>> could be addressed as a LCB library to hook into native compiled code for
>>> each platform. The project itself looks to have make files for all of
>>> platforms of interest in this community.
>> Interesting - I thought we were already linked into libsodium, but I see
>> it's not in the thirdparty directory in the source code. At least not in
>> the foss version.
>> Mark Wieder
>> ahsoftware at gmail.com
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode