Requirements#

Hash Requirements
status: draft
security: NO
safety: ASIL_B
tags: requirements, hash
version: 1

Functional Requirements#

Hash Computation from Byte Data
status: valid
security: YES
safety: ASIL_B
reqtype: Functional
testlink: WorkingDigests/HashCalculatorFactoryCreationTest/0__CalculateSha256 (passed); WorkingDigests/HashCalculatorFactoryCreationTest/0__CalculateCrc32 (passed); WorkingDigests/HashCalculatorFactoryCreationTest/1__CalculateSha256 (passed); WorkingDigests/HashCalculatorFactoryCreationTest/1__CalculateCrc32 (passed); HashCalculatorFactory__HashCalculatorSpanInput (passed); HashCalculatorFactory__HashCalculatorStreamInput (passed); HashCalculatorFactory__FailedHashObjCreation (passed); HashCalculatorFactory__FailedHashObjCreationStream (passed); HashCalculatorFactory__InvalidHashCalculatorSpanInput (passed); HashCalculatorFactory__InvalidhashCalculatorStreamInput (passed); HashCalculatorFactory__FailHashObjCreationWithMaxRead (passed); HashCalculatorFactory__HashCalculatorStreamInputWithMaxRead (passed); HashCalculatorTest__HashAlgorithmsSimpleSha512Test (passed); HashCalculatorTest__UpdateStreamTest (passed); HashCalculatorTest__EmptyUpdateTest (passed); HashCalculatorTest__InvalidDigestUpdateTest (passed); HashCalculatorTest__UpdateFromStreamTest (passed); HashCalculatorTest__InvalidUpdateFromStreamTest (passed); HashCalculatorTest__UpdateFromStreamGoesBadTest (passed); HashCalculatorTest__BadInputUpdateFromStreamTest (passed); HashCalculatorTest__EmptyInputUpdateFromStreamTest (passed); HashCalculatorTest__InvalidFinalizeTest (passed); HashCalculatorSHATest__HashAlgorithmsSimpleTestSha256 (passed); OpensslLibTest__DigestCtxNewTest (passed); OpensslLibTest__DigestInitExTest (passed); OpensslLibTest__DigestUpdateTest (passed); OpensslLibTest__DigestFinalExTest (passed); Crc32IeeeTest__Hash (passed); Crc32IeeeTest__TwoUpdates (passed);
version: 1

The hash library shall compute a hash value over a contiguous byte sequence supplied by the caller, accumulating state across one or more data inputs and producing the final digest upon finalization.

Algorithm Selection via Factory
status: valid
security: YES
safety: ASIL_B

The hash library shall allow the hash algorithm to be selected and a calculator instance to be created independently of the code that performs the computation, so that the calling code is not coupled to any specific algorithm implementation.

Exception-Free Error Propagation
status: valid
security: YES
safety: ASIL_B

The hash library shall propagate errors from hash calculator instantiation via return-value types, enabling use in safety-critical contexts where exception handling is not available.