This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRRX.cs
92 lines (80 loc) · 2.31 KB
/
RRX.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// Licensed Materials - Property of IBM
// 5725-C15
// © Copyright IBM Corp. 1994, 2019 All Rights Reserved
//
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
/*/ch*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace SmartExportTemplates
{
public class RRX : iRRX.iRRXnet // derive from expected interface
{
public RRX()
{
}
#region iRRXnet Members
public string Code
{
get
{
return Properties.Resources.TheRRX;
}
}
public string Help
{
get
{
return "";// Properties.Resources.help;
}
}
public string LoadString(string strStringName, string strDefValue)
{
string strRes = strDefValue;
try
{
strRes = Properties.Resources.ResourceManager.GetString(strStringName);
}
catch (Exception e)
{
strRes = e.Message;
}
return strRes;
}
private long mKeyPairLeft = 0;
private long mKeyPairRight = 0;
public bool RRSID(object sender, long n64KeyPairLeft)
{
if (!(sender is dcrroLib.IRRState))
return false;
Random rnd = new Random(n64KeyPairLeft.GetHashCode());
int n1 = rnd.Next();
int n2 = rnd.Next();
Int64 n64 = n1;
n64 <<= 32;
n64 += n2;
dcrroLib.IRRState iRRSState = sender as dcrroLib.IRRState;
//Int64 n64KeyPairRight = 0;
mKeyPairLeft = n64KeyPairLeft;
mKeyPairRight = n64;
return iRRSState.RRXDLLID(n64KeyPairLeft, n64);
}
public bool SecureCall(long n64KeyPairLeft, long n64KeyPairRight, string strIn, out string strOut)
{
strOut = "";
if (0 == mKeyPairLeft ||
0 == mKeyPairRight ||
mKeyPairLeft != n64KeyPairLeft ||
mKeyPairRight != n64KeyPairRight)
return false;
return true;
}
#endregion
}
}