Documentation ¶
Overview ¶
Copyright (C) 2018 NuCypher
This file is part of goUmbral.
goUmbral is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
goUmbral 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with goUmbral. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2018 NuCypher ¶
This file is part of goUmbral.
goUmbral is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
goUmbral 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with goUmbral. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2018 NuCypher ¶
This file is part of goUmbral.
goUmbral is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
goUmbral 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with goUmbral. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2018 NuCypher ¶
This file is part of goUmbral.
goUmbral is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
goUmbral 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with goUmbral. If not, see <https://www.gnu.org/licenses/>.
This file wraps OpenSSL functions that are relevant to Umbral.
Most of these functions will return errors if they exist.
If there is an error then an OpenSSLError will be returned, otherwise the functions will return a nil error.
Copyright (C) 2018 NuCypher ¶
This file is part of goUmbral.
goUmbral is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
goUmbral 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with goUmbral. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- func AddBN(r, a, b BigNum) error
- func AddECP(group ECGroup, r, a, b ECPoint, ctx BNCtx) error
- func BNIsWithinOrder(checkBN BigNum, curve *Curve) bool
- func BNToBigInt(bn BigNum) (*big.Int, error)
- func BNToBytes(cBN BigNum) ([]byte, error)
- func BNToDecStr(cBN BigNum) string
- func BytesToBigInt(bytes []byte) *big.Int
- func CmpBN(a, b BigNum) int
- func CmpECP(group ECGroup, a, b ECPoint, ctx BNCtx) (bool, error)
- func DivBN(dv, rem, a, d BigNum, ctx BNCtx) error
- func FreeBNCtx(ctx BNCtx)
- func FreeBNMontCtx(montCtx BNMontCtx)
- func FreeBigNum(bn BigNum)
- func FreeECGroup(group ECGroup)
- func FreeECPoint(point ECPoint)
- func GetAffineCoordsFromECPoint(point ECPoint, curve *Curve) (BigNum, BigNum, error)
- func GetECGroupDegree(group ECGroup) uint
- func InvertECP(group ECGroup, a ECPoint, ctx BNCtx) error
- func ModAddBN(r, a, b, m BigNum, ctx BNCtx) error
- func ModBN(rem, a, d BigNum, ctx BNCtx) error
- func ModExpMontBN(r, a, b, m BigNum, ctx BNCtx) error
- func ModInvertBN(r, a, n BigNum, ctx BNCtx) error
- func ModModBN(r, a, m BigNum, ctx BNCtx) error
- func ModMulBN(r, a, b, m BigNum, ctx BNCtx) error
- func ModNegBN(r, a, m BigNum, ctx BNCtx) error
- func ModSubBN(r, a, b, m BigNum, ctx BNCtx) error
- func MulBN(r, a, b BigNum, ctx BNCtx) error
- func MulECP(group ECGroup, r ECPoint, n BigNum, q ECPoint, m BigNum, ctx BNCtx) error
- func RandRangeBN(r, max BigNum) error
- func SetCompressedCoordsECP(group ECGroup, p ECPoint, x BigNum, yBit int, ctx BNCtx) error
- func SizeOfBN(bn BigNum) int
- func SubBN(r, a, b BigNum) error
- type BNCtx
- type BNMontCtx
- type BigNum
- type Curve
- type ECGroup
- type ECPoint
- type OpenSSLError
Constants ¶
const ( SECP256R1 = C.NID_X9_62_prime256v1 SECP256K1 = C.NID_secp256k1 SECP384R1 = C.NID_secp384r1 )
Supported curves
const ERR_R_FATAL = 64
Variables ¶
This section is empty.
Functions ¶
func BNIsWithinOrder ¶
func BNToDecStr ¶
func BytesToBigInt ¶
func FreeBNMontCtx ¶
func FreeBNMontCtx(montCtx BNMontCtx)
func FreeBigNum ¶
func FreeBigNum(bn BigNum)
func FreeECGroup ¶
func FreeECGroup(group ECGroup)
func FreeECPoint ¶
func FreeECPoint(point ECPoint)
func GetECGroupDegree ¶
func ModExpMontBN ¶
ModExpMontBN wraps BN_mod_exp_mont.
func ModInvertBN ¶
ModInvertBN wraps BN_mod_inverse.
func RandRangeBN ¶
RandRangeBN wraps BN_rand_range and places a cryptographically strong pseudo-random number in 'r' in the range 0 <= 'r' < 'max'.
func SetCompressedCoordsECP ¶
Types ¶
type BNMontCtx ¶
type BNMontCtx *C.BN_MONT_CTX
func NewBNMontCtx ¶
func NewBNMontCtx() BNMontCtx
func TmpBNMontCTX ¶
type BigNum ¶
func GetECOrderByGroup ¶
type Curve ¶
func (*Curve) FieldOrderSize ¶
type OpenSSLError ¶
type OpenSSLError struct {
// contains filtered or unexported fields
}
func NewOpenSSLError ¶
func NewOpenSSLError() *OpenSSLError
func (*OpenSSLError) Error ¶
func (m *OpenSSLError) Error() string