Documentation
¶
Overview ¶
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. * * The openwallet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The openwallet library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.
Index ¶
- Constants
- Variables
- func Add(point1, point2 []byte, name string) (point []byte, isinfinity bool)
- func CURVE25519_convert_Ed_to_X(ed []byte) ([]byte, error)
- func CURVE25519_convert_X_to_Ed(x []byte) ([]byte, error)
- func Decryption(prikey []byte, cipher []byte, typeChoose uint32) (plain []byte, ret uint16)
- func ETHsignature(prikey []byte, hash []byte) ([]byte, uint16)
- func Encryption(pubkey []byte, plain []byte, typeChoose uint32) (cipher []byte, ret uint16)
- func GenPubkey(prikey []byte, typeChoose uint32) (pubkey []byte, ret uint16)
- func GetCurveOrder(typeChoose uint32) []byte
- func Hash(data []byte, digestLen uint16, typeChoose uint32) []byte
- func Hmac(key []byte, data []byte, typeChoose uint32) []byte
- func ICX_signature(prikey []byte, hash []byte) ([]byte, uint16)
- func KeyAgreement_initiator_step1(typeChoose uint32) (tmpPrikeyInitiator, tmpPubkeyInitiator []byte)
- func KeyAgreement_initiator_step2(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, ...) (key, Sout []byte, ret uint16)
- func KeyAgreement_responder_ElGamal_step1(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, ...) (key, tmpPubkeyResponder, Sinner, Souter []byte, ret uint16)
- func KeyAgreement_responder_step1(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, ...) (key, tmpPubkeyResponder, Sinner, Souter []byte, ret uint16)
- func KeyAgreement_responder_step2(Sinitiator []byte, Sresponder []byte, typeChoose uint32) uint16
- func Mul(pointin, scalar []byte, name string) (point []byte, isinfinity bool)
- func MulBaseG_Add(pointin, scalar []byte, name string) (point []byte, isinfinity bool)
- func MultiSig_key_exchange_step1(pubkey, random []byte, typeChoose uint32) ([]byte, uint16)
- func MultiSig_key_exchange_step2(prikey, random, tmp_point []byte, typeChoose uint32) ([]byte, uint16)
- func NAS_signature(prikey []byte, hash []byte) ([]byte, uint16)
- func PointCompress(point []byte, typeChoose uint32) []byte
- func PointDecompress(point []byte, typeChoose uint32) []byte
- func Point_add(point1, point2 []byte, typeChoose uint32) ([]byte, uint16)
- func Point_mul(point_in, scalar []byte, typeChoose uint32) ([]byte, uint16)
- func Point_mulBaseG(scalar []byte, typeChoose uint32) []byte
- func Point_mulBaseG_add(pointin, scalar []byte, typeChoose uint32) (point []byte, isinfinity bool)
- func PreprocessRandomNum(rand []byte) (ret uint16)
- func RecoverPubkey(sig []byte, msg []byte, typeChoose uint32) ([]byte, uint16)
- func Signature(prikey []byte, ID []byte, IDlen uint16, message []byte, message_len uint16, ...) (signature []byte, ret uint16)
- func Tron_signature(prikey []byte, hash []byte) ([]byte, uint16)
- func Verify(pubkey []byte, ID []byte, IDlen uint16, message []byte, message_len uint16, ...) uint16
- func ZA(pub *ecdsa.PublicKey, uid []byte) ([]byte, error)
Constants ¶
const ( HASH_ALG_SHA1 = uint32(0xA0000000) HASH_ALG_SHA3_256 = uint32(0xA0000001) HASH_ALG_SHA256 = uint32(0xA0000002) HASH_ALG_SHA512 = uint32(0xA0000003) HASH_ALG_MD4 = uint32(0xA0000004) HASH_ALG_MD5 = uint32(0xA0000005) HASH_ALG_RIPEMD160 = uint32(0xA0000006) HASH_ALG_BLAKE2B = uint32(0xA0000007) HASH_ALG_BLAKE2S = uint32(0xA0000008) HASH_ALG_SM3 = uint32(0xA0000009) HASh_ALG_DOUBLE_SHA256 = uint32(0xA000000A) HASH_ALG_HASH160 = uint32(0xA000000B) HASH_ALG_BLAKE256 = uint32(0xA000000C) HASH_ALG_BLAKE512 = uint32(0xA000000D) HASH_ALG_KECCAK256 = uint32(0xA000000E) HASH_ALG_KECCAK256_RIPEMD160 = uint32(0xA000000F) HASH_ALG_SHA3_256_RIPEMD160 = uint32(0xA0000010) HASH_ALG_KECCAK512 = uint32(0xA0000011) HASH_ALG_SHA3_512 = uint32(0xA0000012) HMAC_SHA256_ALG = uint32(0x50505050) HMAC_SHA512_ALG = uint32(0x50505051) HMAC_SM3_ALG = uint32(0x50505052) ECC_CURVE_SECP256K1 = uint32(0xECC00000) ECC_CURVE_SECP256R1 = uint32(0xECC00001) ECC_CURVE_PRIMEV1 = ECC_CURVE_SECP256R1 ECC_CURVE_NIST_P256 = ECC_CURVE_SECP256R1 ECC_CURVE_SM2_STANDARD = uint32(0xECC00002) ECC_CURVE_ED25519_NORMAL = uint32(0xECC00003) ECC_CURVE_ED25519 = uint32(0xECC00004) ECC_CURVE_X25519 = uint32(0xECC00005) ECC_CURVE_BLS12381_G2_XMD_SHA_256_SSWU_RO_NUL = uint32(0xECC00007) ECC_CURVE_BLS12381_G2_XMD_SHA_256_SSWU_RO_AUG = uint32(0xECC00008) ECC_CURVE_PASTA = uint32(0xECC00009) //签名流程中的随机数是外部传入的标志位置 NOUNCE_OUTSIDE_FLAG = uint32(1 << 8) //外部已经计算消息的哈希值的标识位置 HASH_OUTSIDE_FLAG = uint32(1 << 9) SUCCESS = uint16(0x0001) FAILURE = uint16(0x0000) ECC_PRIKEY_ILLEGAL = uint16(0xE000) ECC_PUBKEY_ILLEGAL = uint16(0xE001) ECC_WRONG_TYPE = uint16(0xE002) ECC_MISS_ID = uint16(0xE003) RAND_IS_NULL = uint16(0xE004) LENGTH_ERROR = uint16(0xE005) POINT_AT_INFINITY = uint16(0xE006) )
const HASH_ALG_DOUBLE_SHA256 = uint32(0xA000000A)
Variables ¶
Functions ¶
func CURVE25519_convert_X_to_Ed ¶
functions to convert between X25519 point and ED25519 point
func Decryption ¶
func ETHsignature ¶
@function:ETH signature @paramter[in]prikey pointer to private key @paramter[in]hash pointer to the hash of message(Transaction txt) @parameter[out]the first part is signature(r||s||v,total 65 byte); the second part
func Encryption ¶
func GetCurveOrder ¶
func ICX_signature ¶
@function:ICX signature @paramter[in]prikey pointer to private key @paramter[in]hash pointer to the hash of message(Transaction txt) @parameter[out]the first part is signature(r||s||v,total 65 byte); the second part
func KeyAgreement_initiator_step1 ¶
func KeyAgreement_initiator_step1(typeChoose uint32) (tmpPrikeyInitiator, tmpPubkeyInitiator []byte)
/////////////////////////////////////////////////////////密钥协商////////////////////////////////////////////////////////
func KeyAgreement_initiator_step2 ¶
func KeyAgreement_initiator_step2(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, IDresponder_len uint16, prikeyInitiator []byte, pubkeyInitiator []byte, pubkeyResponder []byte, tmpPrikeyInitiator []byte, tmpPubkeyInitiator []byte, tmpPubkeyResponder []byte, Sin []byte, keylen uint16, typeChoose uint32) (key, Sout []byte, ret uint16)
func KeyAgreement_responder_ElGamal_step1 ¶
func KeyAgreement_responder_ElGamal_step1(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, IDresponder_len uint16, prikeyResponder []byte, pubkeyResponder []byte, pubkeyInitiator []byte, tmpPubkeyInitiator []byte, keylen uint16, random []byte, typeChoose uint32) (key, tmpPubkeyResponder, Sinner, Souter []byte, ret uint16)
func KeyAgreement_responder_step1 ¶
func KeyAgreement_responder_step1(IDinitiator []byte, IDinitiator_len uint16, IDresponder []byte, IDresponder_len uint16, prikeyResponder []byte, pubkeyResponder []byte, pubkeyInitiator []byte, tmpPubkeyInitiator []byte, keylen uint16, typeChoose uint32) (key, tmpPubkeyResponder, Sinner, Souter []byte, ret uint16)
func MulBaseG_Add ¶
func NAS_signature ¶
@function:ETH signature @paramter[in]prikey pointer to private key @paramter[in]hash pointer to the hash of message(Transaction txt) @parameter[out]the first part is signature(r||s||v,total 65 byte); the second part
func PointCompress ¶
func PointDecompress ¶
func Point_mulBaseG ¶
func Point_mulBaseG_add ¶
all ed25519 data is in little-endian
func PreprocessRandomNum ¶
func Tron_signature ¶
@function:ETH signature(ECDSA&&secp256k1) @paramter[in]prikey pointer to private key @paramter[in]hash pointer to the hash of message(Transaction txt) @parameter[out]the first part is signature(r||s||v,total 65 byte); the second part
Types ¶
This section is empty.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |
edwards25519
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library.
|
* Copyright 2020 The openwallet Authors * This file is part of the openwallet library. |