/** * @author ETSI / STF481 * @version $URL$ * $Id$ * @desc Module containing functions for Security Protocol * */ module LibItsSecurity_Functions { // LibCommon import from LibCommon_BasicTypesAndValues { type UInt64 } import from LibCommon_DataStrings { type Oct32 } group helpersFunctions { /** * @desc Produces a 256-bit (32-byte) hash value * @param TODO * @return TODO */ function f_hashWithSha256(in octetstring p_toBeHashedData) { } /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee * @param TODO * @return TODO */ function f_signWithEcdsaNistp256WithSha256() { } /** * @desc Verify the signature of the specified data * @param TODO * @return true on success, false otherwise */ function f_verifyWithEcdsaNistp256WithSha256() return boolean { return false; } /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm * @param TODO * @return true on success, false otherwise */ function f_generateKeyPair() return boolean { return false; } } // End of group helpersFunctions group externalFunctions { /** * @desc Produces a 256-bit (32-byte) hash value * @param p_toBeHashedData Data to be used to calculate the hash value * @return The hash value */ external function fx_hashWithSha256(in octetstring p_toBeHashedData) return Oct32; /** * @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee * @param p_toBeSignedData The data to be signed * @param p_privateKey The private key * @return The signature value */ external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedData, in UInt64 p_privateKey) return octetstring; /** * @desc Verify the signature of the specified data * @param p_toBeVerifiedData The data to be verified * @param p_signature The signature * @param p_ecdsaNistp256PublicKeyX The public key (x coordinate) * @param p_ecdsaNistp256PublicKeyY The public key (y coordinate) * @return true on success, false otherwise */ external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in Oct32 p_ecdsaNistp256PublicKeyX, in Oct32 p_ecdsaNistp256PublicKeyY) return boolean; /** * @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm * @param p_privateKey The new private key value * @param p_publicKeyX The new public key value (x coordinate) * @param p_publicKeyX The new public key value (y coordinate) * @return true on success, false otherwise */ external function fx_generateKeyPair(out UInt64 p_privateKey, out UInt64 p_publicKeyX, out UInt64 p_publicKeyY) return boolean; } // End of group externalFunctions } // End of module LibItsSecurity_Functions