MIDRANGE dot COM Mailing List Archive



MIDRANGE-L » January 2013

Re: HMAC calculation



Hi Alan -

On Tue, 29 Jan 2013 13:25:40 +0000, Alan Shore <ashore@xxxxxxxx>
wrote:

However, I believe I have found another way - not pretty but it seems to work
Even though my coding of
ConvSecretSharedKey = %trim(HldConvSecretSharedKey) + *allx'00';
Did not compile, I can code the following
Nullfield = *allx'00';
Where Nullfield is defined as
d Nullfield s 1000a
And now my coding is
ConvSecretSharedKey = %trim(HldConvSecretSharedKey) + Nullfield;
And
ConvdataToHash = %trim(HldConvdataToHash) + Nullfield:

IMO the compiler is unnecessarily picky about using those special
values in expressions.

The way I would code something like this is:

targetfield = *loval ;
targetfield = %trimr(sourcefield) + targetfield ;

This way the code continues to work even if the size of targetfield is
increased.

Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2013 by MIDRANGE dot COM 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 here. If you have questions about this, please contact