TestCodec_SecuredFuntions.ttcn 1.24 KB
Newer Older
garciay's avatar
garciay committed
/*
 * @author
 *     
 * @version
 *     1.0
 * @desc
 *     
 * @remark
 *     
 * @see
 *     
 */ 
module TestCodec_SecuredFuntions {
    
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    
    // LibIts
    import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
    import from IEEE1609dot2 language "ASN.1:1997" all;
    import from EtsiTs103097Module language "ASN.1:1997" all;
    
    // LibItsSecurity
    import from LibItsSecurity_EncdecDeclarations all;
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_Functions all;
    import from LibItsSecurity_Pixits all;
    
    // TestCodec
    import from TestCodec_TestAndSystem all;

    testcase tc_sha256_1() runs on TCType system TCType {
      var octetstring v_test := '616263'O;
      var octetstring v_exp_hash := 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'O;
      var Oct32 v_hash;

      v_hash := f_hashWithSha256(v_test);

      if (match(v_hash, v_exp_hash) == false) {
        setverdict(fail);
      } else {
        setverdict(pass);
      }
    } // End of test tc_sha256_1

} // End of module TestCodec_SecuredFuntions