Commit 07f1a5c8 authored by garciay's avatar garciay
Browse files

STF545: Start ECIES implementation

        Validate HMAC-SH256 & AES 128 CCM encryption
parent 0b6eebf3
Loading
Loading
Loading
Loading
+19 −6
Original line number Original line Diff line number Diff line
@@ -151,8 +151,8 @@ module LibItsSecurity_Functions {
                                                      in Oct32 p_peerPublicKeyY,
                                                      in Oct32 p_peerPublicKeyY,
                                                      out Oct32 p_publicEncKeyX, 
                                                      out Oct32 p_publicEncKeyX, 
                                                      out Oct32 p_publicEncKeyY,
                                                      out Oct32 p_publicEncKeyY,
                                                      out Oct16 p_ephKey,
                                                      out Oct16 p_hmac,
                                                      out Oct16 p_tag,
                                                      out Oct16 p_authentication_vector,
                                                      out Oct12 p_nonce
                                                      out Oct12 p_nonce
        ) return octetstring {
        ) return octetstring {
            return fx_encryptWithEciesNistp256WithSha256(
            return fx_encryptWithEciesNistp256WithSha256(
@@ -161,8 +161,8 @@ module LibItsSecurity_Functions {
                p_peerPublicKeyY,
                p_peerPublicKeyY,
                p_publicEncKeyX,
                p_publicEncKeyX,
                p_publicEncKeyY,
                p_publicEncKeyY,
                p_ephKey,
                p_hmac,
                p_tag,
                p_authentication_vector,
                p_nonce
                p_nonce
            );
            );
        } // End of function f_encryptWithEciesNistp256WithSha256
        } // End of function f_encryptWithEciesNistp256WithSha256
@@ -1763,6 +1763,19 @@ module LibItsSecurity_Functions {
             */
             */
            external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring;
            external function fx_signWithEcdsaNistp256WithSha256(in Oct32 p_toBeSignedSecuredMessage, in Oct32 p_privateKey) return octetstring;


            external function fx_test_hmac_sha256(in octetstring p_k, in octetstring p_m) return octetstring;
            /**
             * @desc    Test function the validate AES128 CCM encryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128
             * @return  The encrypted test
             */
            external function fx_test_encrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring;
            
            /**
             * @desc    Test function the validate AES128 CCM decryption based on IEEE Std 1609.2-20XX Annex D.6.1 AES-CCM-128
             * @return  The decrypted test
             */
            external function fx_test_decrypt_aes_128_ccm_test(in octetstring p_k, in octetstring p_n, in octetstring p_pt) return octetstring;
            
            /**
            /**
             * @desc    Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption
             * @desc    Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) encryption
             * @param   p_toBeEncryptedSecuredMessage    The data to be encrypted
             * @param   p_toBeEncryptedSecuredMessage    The data to be encrypted
@@ -1770,7 +1783,7 @@ module LibItsSecurity_Functions {
             * @param   p_publicKeyY                     The public key (Y coordonate)
             * @param   p_publicKeyY                     The public key (Y coordonate)
             * @return  The encrypted value
             * @return  The encrypted value
             */
             */
            external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_ephKey, out Oct16 p_tag, out Oct12 p_nonce) return octetstring;
            external function fx_encryptWithEciesNistp256WithSha256(in octetstring p_toBeEncryptedSecuredMessage, in Oct32 p_peerPublicKeyX, in Oct32 p_peerPublicKeyY, out Oct32 p_publicEncKeyX, out Oct32 p_publicEncKeyY, out Oct16 p_hmac, out Oct16 p_authentication_vector, out Oct12 p_nonce) return octetstring;
            
            
            /**
            /**
             * @desc    Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption
             * @desc    Produces a Elliptic Curve Digital Encrytion Algorithm (ECIES) decryption