void main()
{
hasp_handle_t handle = HASP_INVALID_HANDLE_VALUE;
hasp_status_t status;
const hasp_feature_t feature = HASP_DEFAULT_FID;
status = hasp_login(feature, vendor_code, &handle);
if(status != HASP_STATUS_OK)
{
printf("ERROR! Unlicensed software usage!\n");
exit(0);
}
evaluating_the_function_of_six_variables(func_of_6_variables,delenie);
int bufsize = sizeof(best_variant);
status = hasp_encrypt(handle, &best_variant, bufsize);
if(status != HASP_STATUS_OK)
{
cout <<status<<"\n";
printf("ERROR! Encrypting is wrong!\n");
exit(0);
}
status = hasp_write(handle, HASP_FILEID_RW, 0, bufsize, best_variant);
if(status != HASP_STATUS_OK)
{
cout <<status<<"\n";
printf("ERROR! Writting is wrong!\n");
exit(0);
}
status = hasp_logout(handle);
//
status = hasp_login(feature, vendor_code, &handle);
if(status != HASP_STATUS_OK)
{
printf("ERROR! Unlicensed software usage!\n");
exit(0);
}
hasp_read(handle, HASP_FILEID_RO, 0, bufsize, &best_variant);
status = hasp_decrypt(handle, &best_variant, bufsize);
if(status != HASP_STATUS_OK)
{
cout <<status<<"\n";
printf("ERROR! Decrypting is wrong!\n");
exit(0);
}
status = hasp_logout(handle);
for(int j=0; j<6; j++)
{
printf("%.3f ", best_variant[j]);
}
printf("\n");
}