int

package
v0.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecodeSigned5

func RecodeSigned5(s Signed161) [33]int32

Recode this integer into 33 signed digits for a 5-bit window.

func RecodeSignedFromLimbs

func RecodeSignedFromLimbs(limbs []uint64, ss []int32, w int32)

Types

type Signed161

type Signed161 [3]uint64

A custom 161-bit integer type; used for splitting a scalar into a fraction. Negative values use two's complement notation; the value is truncated to 161 bits (upper bits in the top limb are ignored). Elements are mutable containers. WARNING: everything in here is vartime; do not use on secret values.

func (Signed161) ToU192

func (s Signed161) ToU192() [3]uint64

Export this value as a 192-bit integer (three 64-bit limbs, in little-endian order).

type UInt128

type UInt128 struct {
	Hi, Lo uint64
}

func AddUInt128

func AddUInt128(x, y UInt128) UInt128

func AddUint64

func AddUint64(x, y uint64) UInt128

func AddUint128AndUint64

func AddUint128AndUint64(x UInt128, y uint64) UInt128

func MulUInt64

func MulUInt64(x, y uint64) UInt128

func MulUint128AndUint64

func MulUint128AndUint64(u UInt128, n uint64) (dest UInt128)

func SubUint128AndUint64

func SubUint128AndUint64(x UInt128, y uint64) UInt128

func UInt128FromUint64

func UInt128FromUint64(v uint64) UInt128

func (UInt128) ToBigInt

func (u UInt128) ToBigInt() *big.Int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL