mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-28 15:46:33 +00:00
344 lines
23 KiB
C
344 lines
23 KiB
C
/* Generated by Nim Compiler v1.2.6 */
|
|
/* (c) 2020 Andreas Rumpf */
|
|
/* The generated code is subject to the original license. */
|
|
/* Compiled for: Linux, amd64, gcc */
|
|
/* Command for C compiler:
|
|
gcc -c -w -pthread -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace/install/usr/include -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/src -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/inc -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/tools -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1 -DBR_amd64=1 -DBR_INT128=1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/certs -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1/src -DHAVE_CONFIG_H -DHAVE_BUILTIN_EXPECT -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident -I/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib -I/home/runner/work/nim-waku/nim-waku/waku/v1/node -o nimcache/release/quicksim/@m..@s..@s..@svendor@snim-eth@seth@skeys.nim.c.o nimcache/release/quicksim/@m..@s..@s..@svendor@snim-eth@seth@skeys.nim.c */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
#define nimfr_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ;
|
|
typedef struct tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA;
|
|
typedef struct tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ;
|
|
typedef struct NimStringDesc NimStringDesc;
|
|
typedef struct TGenericSeq TGenericSeq;
|
|
typedef struct tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow;
|
|
typedef struct tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w;
|
|
typedef struct tyObject_SkEcdhRawSecret__neSyoEb7ButpfRk3E5USXQ tyObject_SkEcdhRawSecret__neSyoEb7ButpfRk3E5USXQ;
|
|
typedef struct tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw;
|
|
typedef struct tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA;
|
|
typedef struct tyObject_secp256k1_ecdsa_recoverable_signature__OOP9ck9bXU6uuG4T9bRTry9a4w tyObject_secp256k1_ecdsa_recoverable_signature__OOP9ck9bXU6uuG4T9bRTry9a4w;
|
|
typedef struct tyObject_MDigest__law9ct65KplMYBvtmjCQxbw tyObject_MDigest__law9ct65KplMYBvtmjCQxbw;
|
|
typedef struct tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA;
|
|
typedef struct tySequence__6H5Oh5UUvVCLiakt9aTwtUQ tySequence__6H5Oh5UUvVCLiakt9aTwtUQ;
|
|
typedef NU8 tyArray__w5VB8h5K8DB3oWrO5U2wqg[64];
|
|
struct tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ {tyArray__w5VB8h5K8DB3oWrO5U2wqg data;
|
|
};
|
|
struct tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA {tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ data;
|
|
};
|
|
struct tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ {NIM_BOOL o;
|
|
union{
|
|
struct {NCSTRING e;
|
|
} _o_1;
|
|
struct {tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA v;
|
|
} _o_2;
|
|
};
|
|
};
|
|
struct TGenericSeq {NI len;
|
|
NI reserved;
|
|
};
|
|
struct NimStringDesc { TGenericSeq Sup;NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
typedef NU8 tyArray__DqM3b17bbm0d9bCZr9c2fLDQ[65];
|
|
typedef NU8 tyArray__vEOa9c5qaE9ajWxR5R4zwfQg[32];
|
|
struct tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow {tyArray__vEOa9c5qaE9ajWxR5R4zwfQg data;
|
|
};
|
|
typedef NU8 tyArray__1S3PkXs1i9a3odYVGYxTIlQ[33];
|
|
struct tyObject_SkEcdhRawSecret__neSyoEb7ButpfRk3E5USXQ {tyArray__1S3PkXs1i9a3odYVGYxTIlQ data;
|
|
};
|
|
struct tyObject_secp256k1_ecdsa_recoverable_signature__OOP9ck9bXU6uuG4T9bRTry9a4w {tyArray__DqM3b17bbm0d9bCZr9c2fLDQ data;
|
|
};
|
|
struct tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA {tyObject_secp256k1_ecdsa_recoverable_signature__OOP9ck9bXU6uuG4T9bRTry9a4w data;
|
|
};
|
|
struct tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw {NIM_BOOL o;
|
|
union{
|
|
struct {NCSTRING e;
|
|
} _o_1;
|
|
struct {tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA v;
|
|
} _o_2;
|
|
};
|
|
};
|
|
struct tyObject_MDigest__law9ct65KplMYBvtmjCQxbw {tyArray__vEOa9c5qaE9ajWxR5R4zwfQg data;
|
|
};
|
|
struct tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA {NIM_BOOL o;
|
|
union{
|
|
struct {NCSTRING e;
|
|
} _o_1;
|
|
struct {tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* v;
|
|
} _o_2;
|
|
};
|
|
};
|
|
struct tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w {tyArray__vEOa9c5qaE9ajWxR5R4zwfQg data;
|
|
};
|
|
struct tySequence__6H5Oh5UUvVCLiakt9aTwtUQ { TGenericSeq Sup; NU8 data[SEQ_DECL_SIZE];};static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
|
|
static N_INLINE(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, mapConvert__2DutQRSVWswCB4BH3DtizAresults)(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ* self);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseFieldError)(NimStringDesc* f);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, fromRaw__wuoqSv069a0hw79btLKQagEg)(NU8* data_0, NI data_0Len_0);
|
|
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
|
|
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_SkEcdhRawSecret__neSyoEb7ButpfRk3E5USXQ, ecdhRaw__5dXMEJJpJ79cGRn35x426uw)(tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w* seckey, tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey);
|
|
static N_INLINE(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw, mapConvert__8HzAcchvpyJhRHK9bYKomYwresults)(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw* self);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw, fromRaw__9c9c9bDx6zjYidVWp8PlL9c21Q)(NU8* data_0, NI data_0Len_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_MDigest__law9ct65KplMYBvtmjCQxbw, digest__kUuxyH0Wbp0DnT9anHK9b9c2g)(NU8* data_0, NI data_0Len_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, recover__bxhUvNDVkxv57adfENGDYA)(tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA* sig, tyArray__vEOa9c5qaE9ajWxR5R4zwfQg msg);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, recover__mShg1phNf9aGA6bviy9ajdMQ)(tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA* sig, tyArray__vEOa9c5qaE9ajWxR5R4zwfQg msg);
|
|
static N_INLINE(NimStringDesc*, toHex__WZR7PQRd3CyFIbwX5SDWPAbyteutils)(tyArray__w5VB8h5K8DB3oWrO5U2wqg ba);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toHexAux__mTF3iGytPXR76nCDQ9aqz9cw)(NU8* ba, NI baLen_0);
|
|
N_LIB_PRIVATE N_NIMCALL(void, toRaw__W9bYIkOOHQ8dZSTz9aIjEPEQ)(tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey, tyArray__w5VB8h5K8DB3oWrO5U2wqg Result);
|
|
N_LIB_PRIVATE N_NIMCALL(void, toRaw__bCgy0bI8LIRIvVpAjgBPMg)(tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey, tyArray__DqM3b17bbm0d9bCZr9c2fLDQ Result);
|
|
N_LIB_PRIVATE N_NIMCALL(void, toRaw__QU8um79aWTK6cAEMtJp8d7g)(tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w* seckey, tyArray__vEOa9c5qaE9ajWxR5R4zwfQg Result);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, fromRaw__09bVO0j5Htfp2zQRd1AkcpQ)(NU8* data_0, NI data_0Len_0);
|
|
N_LIB_PRIVATE N_NIMCALL(void, fromHex__ntbsobXtags6pLsk9bwXV6w)(NimStringDesc* s, tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA* Result);
|
|
STRING_LITERAL(TM__M68nGWgBGfdRpIiz8SqAwg_2, "\'v\' is not accessible using discriminant \'o\' of type \'Result\'", 61);
|
|
STRING_LITERAL(TM__M68nGWgBGfdRpIiz8SqAwg_3, "\'e\' is not accessible using discriminant \'o\' of type \'Result\'", 61);
|
|
|
|
#line 22 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_;
|
|
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size)));}
|
|
|
|
#line 33 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
|
|
}
|
|
|
|
#line 366 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
static N_INLINE(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, mapConvert__2DutQRSVWswCB4BH3DtizAresults)(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ* self) { tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ result; nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ));
|
|
#line 370 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
{ tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ T5_; if (!(*self).o) goto LA3_;
|
|
|
|
#line 300 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
nimZeroMem((void*)(&T5_), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ)); T5_.o = NIM_TRUE; if (!(((2 &(1U<<((NU)((*self).o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_2)); } T5_._o_2.v = (*self)._o_2.v; result = T5_; }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ T7_;
|
|
#line 319 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
nimZeroMem((void*)(&T7_), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ)); T7_.o = NIM_FALSE; if (!(((1 &(1U<<((NU)((*self).o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_3)); } T7_._o_1.e = (*self)._o_1.e; result = T7_; }
|
|
LA1_: ;
|
|
return result;}
|
|
|
|
#line 11 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_;
|
|
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));}
|
|
|
|
#line 2112 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
|
|
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
|
|
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
nimCopyMem(dest, source, size);
|
|
}
|
|
|
|
#line 86 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, fromRaw__09bVO0j5Htfp2zQRd1AkcpQ)(NU8* data_0, NI data_0Len_0) { tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ result; tyArray__DqM3b17bbm0d9bCZr9c2fLDQ d; tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ T10_;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ));
|
|
#line 87 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 87 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
{ tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ T5_;
|
|
#line 87 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 87 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
if (!(data_0Len_0 == ((NI) 33))) goto LA3_;
|
|
|
|
#line 88 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 88 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 88 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 88 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
T5_ = fromRaw__wuoqSv069a0hw79btLKQagEg(data_0, data_0Len_0);
|
|
#line 88 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = mapConvert__2DutQRSVWswCB4BH3DtizAresults((&T5_)); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 90 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
{
|
|
#line 90 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 90 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
if (!(data_0Len_0 < ((NI) 64))) goto LA8_;
|
|
|
|
#line 91 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 91 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ)); result.o = NIM_FALSE; result._o_1.e = "keys: raw eth public key should be 64 bytes"; goto BeforeRet_;
|
|
}
|
|
LA8_: ;
|
|
nimZeroMem((void*)d, sizeof(tyArray__DqM3b17bbm0d9bCZr9c2fLDQ));
|
|
#line 95 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
d[(((NI) 0))- 0] = ((NU8) 4);
|
|
#line 96 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
if ((NU)(((NI) 0)) >= (NU)(data_0Len_0)){ raiseIndexError2(((NI) 0),data_0Len_0-1); }
|
|
#line 96 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&d[(((NI) 1))- 0]))), ((void*) ((&data_0[((NI) 0)]))), ((NI) 64));
|
|
|
|
#line 98 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 98 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 98 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
T10_ = fromRaw__wuoqSv069a0hw79btLKQagEg(d, 65);
|
|
#line 98 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = mapConvert__2DutQRSVWswCB4BH3DtizAresults((&T10_)); }BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 241 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow, ecdhRaw__Z9c2Pt1C0AACD1C2XnBvKAA)(tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w* seckey, tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey) { tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow result; tyObject_SkEcdhRawSecret__neSyoEb7ButpfRk3E5USXQ tmp; nimZeroMem((void*)(&result), sizeof(tyObject_SharedSecret__bM0XijkI0NMH9cNiAOpJ9aow));
|
|
#line 242 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 242 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
tmp = ecdhRaw__5dXMEJJpJ79cGRn35x426uw(seckey, pubkey);
|
|
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 245 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&result.data[(((NI) 0))- 0]))), ((void*) ((&tmp.data[(((NI) 1))- 0]))), ((NI) 32));
|
|
return result;}
|
|
|
|
#line 366 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
static N_INLINE(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw, mapConvert__8HzAcchvpyJhRHK9bYKomYwresults)(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw* self) { tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw result; nimZeroMem((void*)(&result), sizeof(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw));
|
|
#line 370 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
{ tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw T5_; if (!(*self).o) goto LA3_;
|
|
|
|
#line 300 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
nimZeroMem((void*)(&T5_), sizeof(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw)); T5_.o = NIM_TRUE; if (!(((2 &(1U<<((NU)((*self).o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_2)); } T5_._o_2.v = (*self)._o_2.v; result = T5_; }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw T7_;
|
|
#line 319 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
nimZeroMem((void*)(&T7_), sizeof(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw)); T7_.o = NIM_FALSE; if (!(((1 &(1U<<((NU)((*self).o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_3)); } T7_._o_1.e = (*self)._o_1.e; result = T7_; }
|
|
LA1_: ;
|
|
return result;}
|
|
|
|
#line 120 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw, fromRaw__Zx9bL0c4s8bWeostmBWcxlw)(NU8* data_0, NI data_0Len_0) { tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw result; tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw T1_; nimZeroMem((void*)(&result), sizeof(tyObject_Result__0DXHAdhUE9c5bTPtcTa9bGcw));
|
|
#line 121 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 121 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 121 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
T1_ = fromRaw__9c9c9bDx6zjYidVWp8PlL9c21Q(data_0, data_0Len_0);
|
|
#line 121 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = mapConvert__8HzAcchvpyJhRHK9bYKomYwresults((&T1_)); return result;}
|
|
|
|
#line 227 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, recover__bxhUvNDVkxv57adfENGDYA)(tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA* sig, tyArray__vEOa9c5qaE9ajWxR5R4zwfQg msg) { tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ result; tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ T1_; nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ));
|
|
#line 228 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 228 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 228 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
T1_ = recover__mShg1phNf9aGA6bviy9ajdMQ(sig, msg);
|
|
#line 228 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = mapConvert__2DutQRSVWswCB4BH3DtizAresults((&T1_)); return result;}
|
|
|
|
#line 230 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, recover__9a61FXOqVqrA7yJk9cxPOcWA)(tyObject_SkRecoverableSignature__uOAg5bLjCmhDkxZdWSR9buA* sig, NU8* msg, NI msgLen_0) { tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ result; tyObject_MDigest__law9ct65KplMYBvtmjCQxbw hash_1; nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ));
|
|
#line 231 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 231 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 231 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
hash_1 = digest__kUuxyH0Wbp0DnT9anHK9b9c2g(msg, msgLen_0);
|
|
#line 232 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 232 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = recover__bxhUvNDVkxv57adfENGDYA(sig, hash_1.data); return result;}
|
|
|
|
#line 131 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/byteutils.nim"
|
|
static N_INLINE(NimStringDesc*, toHex__WZR7PQRd3CyFIbwX5SDWPAbyteutils)(tyArray__w5VB8h5K8DB3oWrO5U2wqg ba) { NimStringDesc* result; result = (NimStringDesc*)0;
|
|
#line 132 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/byteutils.nim"
|
|
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/byteutils.nim"
|
|
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/byteutils.nim"
|
|
result = toHexAux__mTF3iGytPXR76nCDQ9aqz9cw(ba, 64); return result;}
|
|
|
|
#line 103 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(void, toRaw__W9bYIkOOHQ8dZSTz9aIjEPEQ)(tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey, tyArray__w5VB8h5K8DB3oWrO5U2wqg Result) { tyArray__DqM3b17bbm0d9bCZr9c2fLDQ tmp; chckNil((void*)Result); nimZeroMem((void*)Result, sizeof(tyArray__w5VB8h5K8DB3oWrO5U2wqg)); nimZeroMem((void*)tmp, sizeof(tyArray__DqM3b17bbm0d9bCZr9c2fLDQ));
|
|
#line 104 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 104 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
toRaw__bCgy0bI8LIRIvVpAjgBPMg(pubkey, tmp);
|
|
|
|
#line 105 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 105 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&Result[(((NI) 0))- 0]))), ((void*) ((&tmp[(((NI) 1))- 0]))), ((NI) 64));
|
|
}
|
|
|
|
#line 190 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___sCk67mWMaXubq9aFhJ4e9cXw)(tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey) { NimStringDesc* result; tyArray__w5VB8h5K8DB3oWrO5U2wqg T1_; result = (NimStringDesc*)0;
|
|
#line 191 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 192 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 192 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 192 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
nimZeroMem((void*)T1_, sizeof(tyArray__w5VB8h5K8DB3oWrO5U2wqg)); toRaw__W9bYIkOOHQ8dZSTz9aIjEPEQ(pubkey, T1_);
|
|
|
|
#line 192 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = toHex__WZR7PQRd3CyFIbwX5SDWPAbyteutils(T1_); return result;}
|
|
|
|
#line 81 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(void, toRaw__A1jy5RjxYg9aCVFRbqZKqvA)(tyObject_SkSecretKey__aKiBFtqo69b60sWLnM5A9c3w* seckey, tyArray__vEOa9c5qaE9ajWxR5R4zwfQg Result) { tyArray__vEOa9c5qaE9ajWxR5R4zwfQg T1_;
|
|
#line 82 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
|
|
#line 82 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
nimZeroMem((void*)T1_, sizeof(tyArray__vEOa9c5qaE9ajWxR5R4zwfQg)); toRaw__QU8um79aWTK6cAEMtJp8d7g(seckey, T1_);
|
|
nimCopyMem((void*)Result, (NIM_CONST void*)T1_, sizeof(tyArray__vEOa9c5qaE9ajWxR5R4zwfQg));}
|
|
|
|
#line 100 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ, fromHex__LzknCLHfLV4bCCc8XinCGQ)(NimStringDesc* data_0) { tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ result; tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA vX60gensym55295035_;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ));
|
|
#line 101 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
nimZeroMem((void*)(&vX60gensym55295035_), sizeof(tyObject_Result__RiDtbJ9c9bMKur729aT0dTxcA));
|
|
#line 657 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
|
|
#line 101 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
fromHex__ntbsobXtags6pLsk9bwXV6w(data_0, (&vX60gensym55295035_));
|
|
|
|
#line 658 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
{
|
|
#line 658 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
if (!!(vX60gensym55295035_.o)) goto LA3_;
|
|
|
|
#line 662 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
|
|
#line 662 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/results.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__ac12d9bB2oPDNrhZXEa1pxQ)); result.o = NIM_FALSE; if (!(((1 &(1U<<((NU)(vX60gensym55295035_.o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_3)); } result._o_1.e = vX60gensym55295035_._o_1.e; goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
if (!(((2 &(1U<<((NU)(vX60gensym55295035_.o)&7U)))!=0))){ raiseFieldError(((NimStringDesc*) &TM__M68nGWgBGfdRpIiz8SqAwg_2)); }
|
|
#line 101 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/keys.nim"
|
|
result = fromRaw__09bVO0j5Htfp2zQRd1AkcpQ(vX60gensym55295035_._o_2.v->data, (vX60gensym55295035_._o_2.v ? vX60gensym55295035_._o_2.v->Sup.len : 0)); }BeforeRet_: ;
|
|
return result;}
|