SecurityLocalCalculateAuthenticator
CAPL Functions » Security » SecurityLocalCalculateAuthenticator Valid for: CANoe DE • CANoe4SW DENote
ReplacesLocalSecurityCalculateAuthenticator.
Function Syntax
Description
Calculate the authenticator from arbitrary data. The (complete) freshness value must be provided in the function call. Other freshness sources will be ignored. The method returns the truncated freshness via freshness parameter. The calculated authenticator is returned via the TruncatedAuthenticator parameter. The truncated bit lengths of the authenticator and freshness can be modified. The result of this method depends on the security profile which is mapped on the network.Parameters
- dword DATAID: The data ID of the PDU to lookup the desired key in the security source.
- byte payload[]: The payload of the PDU.
- dword payloadLength: The payload length of the PDU in bytes.
- qword truncatedAuthenticatorHigh [Out]: Upper 64 bits of the authenticator (MAC), if authenticator is larger than 64 bits. Otherwise 0;
- qword truncatedAuthenticator [Out]: The full authenticator value or the lower 64 bits of the authenticator (MAC), if authenticator is larger than 64 bits.
- dword truncatedAuthenticatorBitLength [In/Out]: Length of complete authenticator to transmit (length of authInfo if the authenticator is
<= 64bit, otherwise length of authInfo + authInfoHigh). - qword freshness [In/Out]:
- In: The full freshness value for MAC calculation.
- dword truncatedFreshnessBitLength [In/Out]: The length of the truncated freshness in bits.
- dword freshnessValueBitLength: The freshness value length in bits.
- dword freshnessValueId: The freshness value ID of the PDU.
- dword keyId: The ID used to identify the key for calculating the authenticator, if the key is not identified by the data ID.
Return Values
- qword truncatedAuthenticatorHigh [Out]: Upper 64 bits of the authenticator (MAC), if authenticator is larger than 64 bits. Otherwise 0;
- qword truncatedAuthenticator [Out]: The full authenticator value or the lower 64 bits of the authenticator (MAC), if authenticator is larger than 64 bits.
- dword truncatedAuthenticatorBitLength [In/Out]: Length of complete authenticator to transmit (length of authInfo if the authenticator is
<= 64bit, otherwise length of authInfo + authInfoHigh). - qword freshness [In/Out]: In: The full freshness value for MAC calculation. Out: Truncated tx freshness.
- dword truncatedFreshnessBitLength [In/Out]: The length of the truncated freshness in bits.
- 1: Success
- 0: Error, no details
- -1: Invalid handle
- -2: Data incomplete
- -3: Signal length does not fit
- -4: Security source error, no details
- -6: Not supported
- -10: Security is not usable. Reasons can be: Security Manager version is too old. Tool Version is too old. Security Profile is invalid.