Skip to content

Commit ce53ae4

Browse files
committed
test
1 parent faab3f6 commit ce53ae4

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ libjl777/SuperNET.dSYM/Contents/Resources/DWARF/SuperNET
113113
libjl777/picocoin/
114114

115115
libjl777/websocketd/
116+
117+
libjl777/plugins/agents/pangea

libjl777/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ _echodemo := rm agents/echodemo; gcc -o agents/echodemo -O2 $(PINCLUDES) agents/
7979

8080
_shuffle := rm agents/shuffle; gcc -o agents/shuffle -O2 $(PINCLUDES) agents/shuffle777.c $(PLIBS)
8181

82+
_pangea := rm agents/pangea; gcc -o agents/pangea -O2 $(PINCLUDES) games/pangea777.c $(PLIBS)
83+
8284
#_rps := rm agents/rps; gcc -o agents/rps -O2 $(PINCLUDES) common/rps777.c $(PLIBS)
8385

8486
_api := rm cgi/*; gcc -o cgi/api -O2 $(PINCLUDES) agents/api_main.c ccgi/ccgi.c coins/bitcoind_RPC.c $(PLIBS); ln cgi/api cgi/nxt; ln cgi/api cgi/nxts; ln cgi/api cgi/port; ln cgi/api cgi/stringified; ln cgi/api cgi/ports; ln cgi/api cgi/InstantDEX; ln cgi/api cgi/init; ln cgi/api cgi/public
@@ -99,12 +101,16 @@ agents: plugins/agents/echodemo plugins/cgi/api plugins/agents/nxt plugins/agent
99101
cd plugins; \
100102
$(_echodemo); \
101103
#$(_shuffle); \
104+
$(_pangea); \
102105
$(_api); \
103106
cd ..
104107

105108
rps: plugins/agents/rps; \
106109
cd plugins; $(_rps); cd ..
107110

111+
pangea: doesntexist; \
112+
cd plugins; $(_pangea); cd ..
113+
108114
echodemo: doesntexist; \
109115
cd plugins; $(_echodemo); cd ..
110116

libjl777/plugins/InstantDEX/InstantDEX_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ char *InstantDEX(char *jsonstr,char *remoteaddr,int32_t localaccess)
445445
// test: asset/asset, asset/external, external/external, autofill and automatch
446446
// peggy integration
447447
if ( bidask_parse(localaccess,&exchangestr,&name,&base,&rel,&gui,&iQ,json) < 0 && strcmp(exchangestr.buf,"jumblr") == 0 )
448-
return(clonestr("{\"error\":\"invalid parameters\"}"));
448+
{
449+
//return(clonestr("{\"error\":\"invalid parameters\"}"));
450+
}
449451
if ( iQ.s.offerNXT == 0 )
450452
iQ.s.offerNXT = SUPERNET.my64bits;
451453
//printf("isask.%d base.(%s) rel.(%s)\n",iQ.s.isask,base.buf,rel.buf);

libjl777/plugins/includes/portable777.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ struct pingpong_queue
8080
#define BTCDADDRSIZE 36
8181
union _bits128 { uint8_t bytes[16]; uint16_t ushorts[8]; uint32_t uints[4]; uint64_t ulongs[2]; uint64_t txid; };
8282
typedef union _bits128 bits128;
83+
#ifndef bits256
8384
union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uint64_t ulongs[4]; uint64_t txid; };
8485
typedef union _bits256 bits256;
86+
#endif
87+
88+
#ifndef bits320
8589
union _bits320 { uint8_t bytes[40]; uint16_t ushorts[20]; uint32_t uints[10]; uint64_t ulongs[5]; uint64_t txid; };
8690
typedef union _bits320 bits320;
91+
#endif
92+
8793
union _bits384 { bits256 sig; uint8_t bytes[48]; uint16_t ushorts[24]; uint32_t uints[12]; uint64_t ulongs[6]; uint64_t txid; };
8894
typedef union _bits384 bits384;
8995

libjl777/plugins/utils/curve25519.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
#ifndef dcnet_curve25519_h
1818
#define dcnet_curve25519_h
1919

20+
#ifndef bits320
21+
union _bits320 { uint8_t bytes[40]; uint16_t ushorts[20]; uint32_t uints[10]; uint64_t ulongs[5]; uint64_t txid; };
22+
typedef union _bits320 bits320;
23+
#endif
24+
25+
#ifndef bits256
26+
union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uint64_t ulongs[4]; uint64_t txid; };
27+
typedef union _bits256 bits256;
28+
#endif
2029

2130
// special gcc mode for 128-bit integers. It's implemented on 64-bit platforms only as far as I know.
2231
typedef unsigned uint128_t __attribute__((mode(TI)));
@@ -282,6 +291,22 @@ static inline bits320 force_inline crecip(const bits320 z)
282291
/* 2^255 - 21 */ return(fmul(t0, a));
283292
}
284293

294+
static bits256 curve25519(bits256 mysecret,bits256 basepoint)
295+
{
296+
bits320 bp,x,z;
297+
bp = fexpand(basepoint);
298+
cmult(&x,&z,mysecret,bp);
299+
return(fcontract(fmul(x,crecip(z))));
300+
}
301+
302+
static bits256 rand256(int32_t privkeyflag)
303+
{
304+
bits256 randval;
305+
randombytes(randval.bytes,sizeof(randval));
306+
if ( privkeyflag != 0 )
307+
randval.bytes[0] &= 0xf8, randval.bytes[31] &= 0x7f, randval.bytes[31] |= 0x40;
308+
return(randval);
309+
}
285310
// following is ported from libtom
286311
struct sha256_vstate { uint64_t length; uint32_t state[8],curlen; uint8_t buf[64]; };
287312

0 commit comments

Comments
 (0)