[SLOF] [PATCH v6 5/7] tpm: Add sha256 implementation

Stefan Berger stefanb at linux.ibm.com
Mon Jan 20 23:35:50 AEDT 2020


On 1/20/20 3:10 AM, Alexey Kardashevskiy wrote:
>
> On 16/01/2020 07:00, Stefan Berger wrote:
>> The following patch adds a SHA256 implementation based on the algorithm
>> description in NIST FIPS PUB 180-4. The patch includes test cases that test
>> the sha256 implementation and pass on big and little endian ppc64 hosts.
> + sha256_do(&ctx, data, length);
>> +	memcpy(hash, &ctx.h[0], 32);
> s/32/sizeof(ctx)/ ? I

Right.


>
>> +
>> +	return 0;
> Make sha256() return void then?


Will change.


>
>
>> +}
>> +
>> +#ifdef HAVE_MAIN
>
> I suppose the tests have passed so we do not really need the tests in
> the SLOF tree, no? I strongly suspect nobody will ever run this. Thanks,


They are there to show that this implementation is correct. I will 
remove them.




More information about the SLOF mailing list