Documentation ¶
Index ¶
- Constants
- Variables
- func Add(dst []byte, src ...[]byte)
- func AppendBigUint16(b []byte, v uint16) []byte
- func AppendBigUint32(b []byte, v uint32) []byte
- func AppendBigUint64(b []byte, v uint64) []byte
- func AppendBigUint8(b []byte, v byte) []byte
- func BigCeilLog2(n *big.Int, e int) int
- func BigEqual(a, b *big.Int) bool
- func BigLog2(n *big.Int) int
- func BigLog2e(n *big.Int, e int) int
- func BitsToBytes(bits int) int
- func BytesClone(b []byte) []byte
- func CeilDiv(a, b int) int
- func ConsumeBigU16(b []byte) ([]byte, uint16)
- func ConsumeBigU32(b []byte) ([]byte, uint32)
- func ConsumeBigU64(b []byte) ([]byte, uint64)
- func FermatInverse(k, P *big.Int) *big.Int
- func Grow(buf []byte, bytes int) []byte
- func H(s string) string
- func HB(s string) []byte
- func HI(s string) *big.Int
- func IncCtr(b []byte)
- func LeftMost(b []byte, bits int) []byte
- func ReadBigInt(dst *big.Int, rand io.Reader, buf []byte, max *big.Int) (bufNew []byte, err error)
- func ReadBits(dst []byte, rand io.Reader, bits int) ([]byte, error)
- func ReadBytes(dst []byte, rand io.Reader, bytes int) ([]byte, error)
- func ReadInt(r io.Reader, max int) (int, error)
- func Resize(arr []byte, bytes int) []byte
- func RightMost(b []byte, bits int) []byte
- func SliceForAppend(in []byte, n int) (head, tail []byte)
- func StringClone(s string) string
- type Hash
Constants ¶
View Source
const NumMRTests = 64
Variables ¶
Functions ¶
func AppendBigUint16 ¶ added in v1.3.0
func AppendBigUint32 ¶ added in v1.3.0
func AppendBigUint64 ¶ added in v1.3.0
func AppendBigUint8 ¶ added in v1.3.0
func BigCeilLog2 ¶ added in v1.3.0
= ceil(log(n) / log(2 ** e))
func BitsToBytes ¶ added in v1.3.0
func BytesClone ¶ added in v1.3.0
Clone returns a copy of b[:len(b)]. The result may have additional unused capacity. Clone(nil) returns nil.
func ConsumeBigU16 ¶ added in v1.3.0
func ConsumeBigU32 ¶ added in v1.3.0
func ConsumeBigU64 ¶ added in v1.3.0
func FermatInverse ¶
https://cs.opensource.google/go/go/+/refs/tags/go1.18:src/crypto/dsa/dsa.go;l=188-192 fermatInverse calculates the inverse of k in GF(P) using Fermat's method. This has better constant-time properties than Euclid's method (implemented in math/big.Int.ModInverse) although math/big itself isn't strictly constant-time so it's not perfect.
func ReadBigInt ¶ added in v1.3.0
ReadBigInt returns a uniform random value in [0, max). It panics if max <= 0.
func SliceForAppend ¶ added in v1.3.0
func StringClone ¶ added in v1.3.0
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package alias implements memory aliasing tests.
|
Package alias implements memory aliasing tests. |
drbg
|
|
golang.org
|
|
x/crypto/cryptobyte
Package cryptobyte contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER.
|
Package cryptobyte contains types that help with parsing and constructing length-prefixed, binary messages, including ASN.1 DER. |
x/crypto/cryptobyte/asn1
Package asn1 contains supporting types for parsing and building ASN.1 messages with the cryptobyte package.
|
Package asn1 contains supporting types for parsing and building ASN.1 messages with the cryptobyte package. |
x/sys/cpu
Package cpu implements processor feature detection for various CPU architectures.
|
Package cpu implements processor feature detection for various CPU architectures. |
Package randutil contains internal randomness utilities for various crypto packages.
|
Package randutil contains internal randomness utilities for various crypto packages. |
Click to show internal directories.
Click to hide internal directories.