Commit 6a63150c authored by Denis Filatov's avatar Denis Filatov
Browse files

add some mw_ templates

use titan internal OER encoding
(todo remove ext functions from adapter)
parent a68f9679
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -14,10 +14,10 @@ module LibItsSecurity_EncdecDeclarations {
     * @return The encode message in OER format
     */
    external function fx_enc_CertificateBase(in Ieee1609Dot2.CertificateBase p) return bitstring
      with {extension "prototype(convert) encode(PER)"}
      with {extension "prototype(convert) encode(OER)"}
    
    external function fx_dec_CertificateBase(inout bitstring b, out Ieee1609Dot2.CertificateBase p) return integer
        with {extension "prototype(sliding) decode(PER)"}
        with {extension "prototype(sliding) decode(OER)"}
    
    /**
     * @desc Encoding function for Ieee1609Dot2.ToBeSignedCertificate
@@ -25,7 +25,7 @@ module LibItsSecurity_EncdecDeclarations {
     * @return The encode message in OER format
     */
    external function fx_enc_ToBeSignedCertificate(in Ieee1609Dot2.ToBeSignedCertificate p) return bitstring
        with {extension "prototype(convert) encode(PER)"}
        with {extension "prototype(convert) encode(OER)"}
    
    /**
     * @desc Encoding function for Ieee1609Dot2.Ieee1609Dot2Data
@@ -33,16 +33,16 @@ module LibItsSecurity_EncdecDeclarations {
     * @return The encode message in OER format
     */
    external function fx_enc_Ieee1609Dot2Data(in Ieee1609Dot2.Ieee1609Dot2Data p) return bitstring
    with {extension "prototype(convert) encode(PER)"}
    with {extension "prototype(convert) encode(OER)"}

    external function fx_dec_Ieee1609Dot2Data(inout bitstring p_data, out Ieee1609Dot2.Ieee1609Dot2Data p_ieee1609Dot2Data) return integer
        with {extension "prototype(sliding) decode(PER)"}
        with {extension "prototype(sliding) decode(OER)"}
    
    external function fx_enc_Ieee1609Dot2ToBeSignedData(in Ieee1609Dot2.ToBeSignedData p) return bitstring
    with {extension "prototype(convert) encode(PER)"}
    with {extension "prototype(convert) encode(OER)"}

    external function fx_dec_Ieee1609Dot2ToBeSignedData(inout bitstring p_data, out Ieee1609Dot2.ToBeSignedData p_toBeSignedData) return integer
        with {extension "prototype(sliding) decode(PER)"}
        with {extension "prototype(sliding) decode(OER)"}
    
    external function fx_enc_SspCAM (LibItsSecurity_TypesAndValues.SspCAM p_ssp) return bitstring
        with {extension "prototype(convert) encode(LibItsSecurity)"}
+11 −0
Original line number Diff line number Diff line
@@ -352,6 +352,10 @@ module LibItsSecurity_Templates {
                    digest := p_digest
                } // End of template mw_signerIdentifier_digest
                
                template (present) SignerIdentifier mw_signerIdentifier_self := {
                    self_ := ?
                } // End of template mw_signerIdentifier_self

                template (present) SignerIdentifier mw_signerIdentifier_certificate(
                                                                                    template (present) EtsiTs103097Certificate p_certificate  := ?
                ) := {
@@ -530,6 +534,13 @@ module LibItsSecurity_Templates {
            content         := { unsecuredData := p_unsecuredData }
        } // End of template m_secured_data_unsecured

        template (present) EtsiTs103097Data mw_etsiTs103097Data_unsecured(
                                                                          in template (present) Opaque p_unsecuredData := ?
        ) := {
            protocolVersion := c_protocol_version,
            content         := { unsecuredData := p_unsecuredData }
        } // End of template mw_secured_data_unsecured
        
        template (value) EtsiTs103097Data m_etsiTs103097Data_signed(
                                                                    in template (value) SignedData p_signedData
        ) := {