
// ---------------------------------------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 = {

	DES_NovyIV : function(){
		return this.marshaller.invoke(0, 0x2EB6, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	DES_NovyKlic : function(KeySize){
		return this.marshaller.invoke(1, 0x80D5, MARSHALLER_TYPE_IN_S4, KeySize, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	AES_NovyIV : function(){
		return this.marshaller.invoke(0, 0x9986, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	AES_NovyKlic : function(KeySize){
		return this.marshaller.invoke(1, 0x10AF, MARSHALLER_TYPE_IN_S4, KeySize, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Enc_DES : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0xF49F, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Dec_DES : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0x7D4C, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Enc_AES : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0xB6D8, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Dec_AES : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0xBCC9, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	getMemory : function(){
		return this.marshaller.invoke(0, 0x40FB, MARSHALLER_TYPE_RET_S4);
	},

	Power : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0xEFDB, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	DePower : function(baze,exponent,modulus){
		return this.marshaller.invoke(3, 0x4348, MARSHALLER_TYPE_IN_U1ARRAY, baze, MARSHALLER_TYPE_IN_U1ARRAY, exponent, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	SetRSAsize : function(size){
		this.marshaller.invoke(1, 0x5F95, MARSHALLER_TYPE_IN_S4, size, MARSHALLER_TYPE_RET_VOID);
	},

	Multiply : function(a_byte,b_byte,mod_byte){
		return this.marshaller.invoke(3, 0x29F5, MARSHALLER_TYPE_IN_U1ARRAY, a_byte, MARSHALLER_TYPE_IN_U1ARRAY, b_byte, MARSHALLER_TYPE_IN_U1ARRAY, mod_byte, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	ArrAddSimple : function(a,b,modulus){
		return this.marshaller.invoke(3, 0x669E, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_IN_U1ARRAY, modulus, 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);
	},

	ArrHalfSimple : function(input,modulus){
		return this.marshaller.invoke(2, 0xFC3C, MARSHALLER_TYPE_IN_U1ARRAY, input, MARSHALLER_TYPE_IN_U1ARRAY, modulus, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	RandomGen : function(input,ofset,length){
		return this.marshaller.invoke(3, 0xF703, MARSHALLER_TYPE_IN_U1ARRAY, input, MARSHALLER_TYPE_IN_S4, ofset, MARSHALLER_TYPE_IN_S4, length, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getc11 : function(){
		return this.marshaller.invoke(0, 0x657A, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getc22 : function(){
		return this.marshaller.invoke(0, 0x7C13, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getc33 : function(){
		return this.marshaller.invoke(0, 0x2C00, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getz1i : function(){
		return this.marshaller.invoke(0, 0x214C, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getz2 : function(){
		return this.marshaller.invoke(0, 0xF51A, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getz2i : function(){
		return this.marshaller.invoke(0, 0xFAC1, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getc3 : function(){
		return this.marshaller.invoke(0, 0x76A2, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	Getz1 : function(){
		return this.marshaller.invoke(0, 0x24AF, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	ArrMultiObecneOpt2 : function(a,b){
		return this.marshaller.invoke(2, 0x874B, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	CombaOpt : function(a,b,size){
		return this.marshaller.invoke(3, 0x0CDB, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_IN_S4, size, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	ArrMultiMontgomeryREV : function(x,y,m,N,mQ){
		return this.marshaller.invoke(5, 0x0531, MARSHALLER_TYPE_IN_U1ARRAY, x, MARSHALLER_TYPE_IN_U1ARRAY, y, MARSHALLER_TYPE_IN_U1ARRAY, m, MARSHALLER_TYPE_IN_S4, N, MARSHALLER_TYPE_IN_S4, mQ, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	UrciVetsiInt : function(a,b){
		return this.marshaller.invoke(2, 0xFA7C, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_RET_BOOL);
	},

	RedukceByteArr : function(a){
		return this.marshaller.invoke(1, 0xBF06, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_RET_U1ARRAY);
	},

	ArrAddEqual : function(a,b){
		return this.marshaller.invoke(2, 0x9964, MARSHALLER_TYPE_IN_U1ARRAY, a, MARSHALLER_TYPE_IN_U1ARRAY, b, MARSHALLER_TYPE_RET_U1ARRAY);
	},

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

};
