
// ---------------------------------------Service.js
SConnect.RegisterNamespace("MyCompany.Server");

MyCompany.Server.Service = function(readerName,portNum,serviceName){
	this.marshaller = new SConnect.Marshaller(readerName,portNum,serviceName,0xE38E8F, 0xBAC2);
}

MyCompany.Server.Service.prototype = {

	Registration : function(Hash,Ri){
		return this.marshaller.invoke(2, 0x0CAB, MARSHALLER_TYPE_IN_STRING, Hash, MARSHALLER_TYPE_IN_STRING, Ri, MARSHALLER_TYPE_RET_STRING);
	},

	Login : function(PWD,timestamp){
		return this.marshaller.invoke(2, 0x7374, MARSHALLER_TYPE_IN_STRING, PWD, MARSHALLER_TYPE_IN_STRING, timestamp, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Verification : function(timestamp){
		return this.marshaller.invoke(1, 0x9E37, MARSHALLER_TYPE_IN_STRING, timestamp, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	GetRi : function(){
		return this.marshaller.invoke(0, 0xBB6D, MARSHALLER_TYPE_RET_STRING);
	},

	Registration_Hsiang : function(V,R,hash){
		return this.marshaller.invoke(3, 0x0E88, MARSHALLER_TYPE_IN_STRING, V, MARSHALLER_TYPE_IN_STRING, R, MARSHALLER_TYPE_IN_STRING, hash, MARSHALLER_TYPE_RET_STRING);
	},

	Login_Hsiang : function(pwdhash,timestamp){
		return this.marshaller.invoke(2, 0xAA33, MARSHALLER_TYPE_IN_U1ARRAY, pwdhash, MARSHALLER_TYPE_IN_STRING, timestamp, MARSHALLER_TYPE_RET_STRINGARRAY);
	},

	Verification_Hsiang : function(pwdhash){
		return this.marshaller.invoke(1, 0xCDE5, MARSHALLER_TYPE_IN_U1ARRAY, pwdhash, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	GetRi_Hsiang : function(){
		return this.marshaller.invoke(0, 0x18DD, MARSHALLER_TYPE_RET_STRING);
	},

	Registration_Improved : function(ID,A,B,p,g){
		return this.marshaller.invoke(5, 0xB1BE, MARSHALLER_TYPE_IN_STRING, ID, MARSHALLER_TYPE_IN_STRING, A, MARSHALLER_TYPE_IN_STRING, B, MARSHALLER_TYPE_IN_STRING, p, MARSHALLER_TYPE_IN_STRING, g, MARSHALLER_TYPE_RET_STRING);
	},

	Login_Improved : function(){
		return this.marshaller.invoke(0, 0xA8EE, MARSHALLER_TYPE_RET_STRINGARRAY);
	},

	Verification_Nonce : function(pwdhash){
		return this.marshaller.invoke(1, 0xF99E, MARSHALLER_TYPE_IN_U1ARRAY, pwdhash, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Registration_nova : function(V,R,hash){
		return this.marshaller.invoke(3, 0xCE08, MARSHALLER_TYPE_IN_STRING, V, MARSHALLER_TYPE_IN_STRING, R, MARSHALLER_TYPE_IN_STRING, hash, MARSHALLER_TYPE_RET_STRING);
	},

	GetR_nova : function(timestamp){
		return this.marshaller.invoke(1, 0x5450, MARSHALLER_TYPE_IN_STRING, timestamp, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Login_nova : function(pwdhash,timestamp){
		return this.marshaller.invoke(2, 0x6EA6, MARSHALLER_TYPE_IN_U1ARRAY, pwdhash, MARSHALLER_TYPE_IN_STRING, timestamp, MARSHALLER_TYPE_RET_STRINGARRAY);
	},

	Verification_nova : function(pwdhash){
		return this.marshaller.invoke(1, 0xD005, MARSHALLER_TYPE_IN_U1ARRAY, pwdhash, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	ArrSubSimple : function(a,b,modulus){
		return this.marshaller.invoke(3, 0xDDCC, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	dispose : function(){
		this.marshaller.dispose();
	}

};
