crypto/internal/fips140/bigmod.Nat.Bytes (method)
34 uses
crypto/internal/fips140/bigmod (current package)
nat.go#L148: func (x *Nat) Bytes(m *Modulus) []byte {
crypto/internal/fips140/ecdsa
ecdsa.go#L79: c.nMinus2 = bigmod.NewNat().ExpandFor(c.N).Sub(two, c.N).Bytes(c.N)
ecdsa.go#L168: priv := &PrivateKey{pub: *pub, d: d.Bytes(c.N)}
ecdsa.go#L204: d: k.Bytes(c.N),
ecdsa.go#L250: p, err := c.newPoint().ScalarBaseMult(k.Bytes(c.N))
ecdsa.go#L322: return e.Bytes(c.N)
ecdsa.go#L372: return &Signature{r.Bytes(c.N), s.Bytes(c.N)}, nil
ecdsa.go#L378: kBytes, err := c.ordInverse(k.Bytes(c.N))
ecdsa.go#L479: p1, err := c.newPoint().ScalarBaseMult(e.Mul(w, c.N).Bytes(c.N))
ecdsa.go#L484: p2, err := Q.ScalarMult(Q, w.Mul(r, c.N).Bytes(c.N))
crypto/internal/fips140/rsa
keygen.go#L155: return bigmod.NewModulusProduct(a.Bytes(p), b.Bytes(q))
keygen.go#L336: mr.m = m.Bytes(mr.w)
rsa.go#L74: pMinusOneMod, err := bigmod.NewModulus(pMinusOne.Bytes(p))
rsa.go#L78: dP := bigmod.NewNat().Mod(d, pMinusOneMod).Bytes(pMinusOneMod)
rsa.go#L81: qMinusOneMod, err := bigmod.NewModulus(qMinusOne.Bytes(q))
rsa.go#L85: dQ := bigmod.NewNat().Mod(d, qMinusOneMod).Bytes(qMinusOneMod)
rsa.go#L93: pMinusTwo := p.Nat().SubOne(p).SubOne(p).Bytes(p)
rsa.go#L176: N = priv.pub.N.Nat().Bytes(priv.pub.N)
rsa.go#L178: d = priv.d.Bytes(priv.pub.N)
rsa.go#L182: P = priv.p.Nat().Bytes(priv.p)
rsa.go#L183: Q = priv.q.Nat().Bytes(priv.q)
rsa.go#L186: qInv = priv.qInv.Bytes(priv.p)
rsa.go#L218: if _, err := pN.SetBytes(p.Nat().Bytes(p), N); err != nil {
rsa.go#L222: if _, err := qN.SetBytes(q.Nat().Bytes(q), N); err != nil {
rsa.go#L238: pMinus1, err := bigmod.NewModulus(p.Nat().SubOne(p).Bytes(p))
rsa.go#L253: qMinus1, err := bigmod.NewModulus(q.Nat().SubOne(q).Bytes(q))
rsa.go#L268: qP, err := bigmod.NewNat().SetOverflowingBytes(q.Nat().Bytes(q), p)
rsa.go#L284: if qP, err := bigmod.NewNat().SetBytes(q.Nat().Bytes(q), p); err != nil {
rsa.go#L286: pQ, err := bigmod.NewNat().SetBytes(p.Nat().Bytes(p), q)
rsa.go#L390: return bigmod.NewNat().ExpShortVarTime(m, uint(pub.E), pub.N).Bytes(pub.N), nil
rsa.go#L432: m = bigmod.NewNat().Exp(c, priv.d.Bytes(N), N)
rsa.go#L458: return m.Bytes(N), nil