This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
[ Picked text/plain from multipart/alternative ]
I've received some C code to perform sha encryption from a vendor.  I've
gotten it compiled into a CLE module and then created into a SRVPGM, and the
400's happy so far.  Now I need to call a function in there.

The exports on the SRVPGM read:

                               Procedure Exports:

 Procedure Name
 sha_final                                                               *NO

 sha_init                                                                *NO

 sha_update                                                              *NO

 sha1                                                                    *NO

The procedure vendor says to call reads:

void sha1( void *buf, unsigned long len, unsigned long *iv, unsigned long
digest[5] )

 SHA_INFO sha_info;

 sha_init(&sha_info, iv);

 sha_update(&sha_info, buf, len);


 memcpy(digest, sha_info.digest, sizeof( sha_info.digest ) );

 memset(&sha_info, 0, sizeof( sha_info));


and I'm trying to figure out the prototype.

Is it:

D Sha1            PR
D  Buffer                    32767a   Const Options(*Varsize)
D  BfrLength                    10i 0 Const
D  IV                           10i 0 Const
D  Digest                       10i 0 Dim(5)

What this thing does is encrypt a 4 digit PIN# in some *nix like fashion
where the pin starts out as 1234 and ends up as 28AAF4DD B1B62407 E90CFDD5
4B1E31F8 236E59F3.

So I guess I do something RPGIV like:

Sha1( PIN# : %len(PIN#) : ???? : Digest );

where Digest is an RPGIV array of 8a dim(5)?

I have no idea what the *buf and *iv things mean.

TIA for any help you can offer!

Tom Westdorp
Station Casinos

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].