bits256 SuperNET_wallet2shared(bits256 wallethash,bits256 wallet2priv) { bits256 wallet2shared,seed,wallet2pub; wallet2pub = curve25519(wallet2priv,curve25519_basepoint9()); seed = curve25519_shared(wallethash,wallet2pub); vcalc_sha256(0,wallet2shared.bytes,seed.bytes,sizeof(bits256)); return(wallet2shared); }
bits256 cards777_initcrypt(bits256 data,bits256 privkey,bits256 pubkey,int32_t invert) { bits256 hash; bits320 hexp; hash = curve25519_shared(privkey,pubkey); hexp = fexpand(hash); if ( invert != 0 ) hexp = crecip(hexp); return(fcontract(fmul(fexpand(data),hexp))); }