- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 66 for Curve (0.07 sec)
-
src/crypto/ecdsa/ecdsa_test.go
if line[0] == '[' { line = line[1 : len(line)-1] curve, hash, _ := strings.Cut(line, ",") switch curve { case "P-224": pub.Curve = elliptic.P224() case "P-256": pub.Curve = elliptic.P256() case "P-384": pub.Curve = elliptic.P384() case "P-521": pub.Curve = elliptic.P521() default: pub.Curve = nil } switch hash { case "SHA-1":
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:33:58 UTC 2024 - 13.5K bytes - Viewed (0) -
src/crypto/x509/sec1.go
} var curve elliptic.Curve if namedCurveOID != nil { curve = namedCurveFromOID(*namedCurveOID) } else { curve = namedCurveFromOID(privKey.NamedCurveOID) } if curve == nil { return nil, errors.New("x509: unknown elliptic curve") } k := new(big.Int).SetBytes(privKey.PrivateKey) curveOrder := curve.Params().N if k.Cmp(curveOrder) >= 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 4.6K bytes - Viewed (0) -
src/crypto/ecdsa/ecdsa.go
c := curveToECDH(k.Curve) if c == nil { return nil, errors.New("ecdsa: unsupported curve by crypto/ecdh") } if !k.Curve.IsOnCurve(k.X, k.Y) { return nil, errors.New("ecdsa: invalid public key") } return c.NewPublicKey(elliptic.Marshal(k.Curve, k.X, k.Y)) } // Equal reports whether pub and x have the same value. // // Two keys are only considered to have the same value if they have the same Curve value.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 00:11:18 UTC 2024 - 20.4K bytes - Viewed (0) -
src/crypto/ecdh/ecdh.go
// // This check is performed in constant time as long as the key types and their // curve match. func (k *PublicKey) Equal(x crypto.PublicKey) bool { xx, ok := x.(*PublicKey) if !ok { return false } return k.curve == xx.curve && subtle.ConstantTimeCompare(k.publicKey, xx.publicKey) == 1 } func (k *PublicKey) Curve() Curve { return k.curve } // PrivateKey is an ECDH private key, usually kept secret. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 6.4K bytes - Viewed (0) -
src/crypto/elliptic/params.go
// use that instead of the generic one. if specific, ok := matchesSpecificCurve(curve); ok { return specific.Add(x1, y1, x2, y2) } panicIfNotOnCurve(curve, x1, y1) panicIfNotOnCurve(curve, x2, y2) z1 := zForAffine(x1, y1) z2 := zForAffine(x2, y2) return curve.affineFromJacobian(curve.addJacobian(x1, y1, z1, x2, y2, z2)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 16 17:46:09 UTC 2024 - 9.6K bytes - Viewed (0) -
src/crypto/ecdh/x25519.go
} return &PrivateKey{ curve: c, privateKey: append([]byte{}, key...), }, nil } func (c *x25519Curve) privateKeyToPublicKey(key *PrivateKey) *PublicKey { if key.curve != c { panic("crypto/ecdh: internal error: converting the wrong key type") } k := &PublicKey{ curve: key.curve, publicKey: make([]byte, x25519PublicKeySize), }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 3.1K bytes - Viewed (0) -
src/crypto/elliptic/elliptic.go
func Marshal(curve Curve, x, y *big.Int) []byte { panicIfNotOnCurve(curve, x, y) byteLen := (curve.Params().BitSize + 7) / 8 ret := make([]byte, 1+2*byteLen) ret[0] = 4 // uncompressed point x.FillBytes(ret[1 : 1+byteLen]) y.FillBytes(ret[1+byteLen : 1+2*byteLen]) return ret } // MarshalCompressed converts a point on the curve into the compressed form
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 9K bytes - Viewed (0) -
src/crypto/ecdh/nist.go
if err != nil { return nil, err } return newBoringPrivateKey(c, bk, key) } k := &PrivateKey{ curve: c, privateKey: append([]byte{}, key...), } return k, nil } func newBoringPrivateKey(c Curve, bk *boring.PrivateKeyECDH, privateKey []byte) (*PrivateKey, error) { k := &PrivateKey{ curve: c, boring: bk, privateKey: append([]byte(nil), privateKey...), } return k, nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 18:57:38 UTC 2024 - 8.1K bytes - Viewed (0) -
src/crypto/ecdh/ecdh_test.go
} = &ecdh.PrivateKey{} func TestECDH(t *testing.T) { testAllCurves(t, func(t *testing.T, curve ecdh.Curve) { aliceKey, err := curve.GenerateKey(rand.Reader) if err != nil { t.Fatal(err) } bobKey, err := curve.GenerateKey(rand.Reader) if err != nil { t.Fatal(err) } alicePubKey, err := curve.NewPublicKey(aliceKey.PublicKey().Bytes()) if err != nil { t.Error(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 27 18:23:49 UTC 2024 - 18K bytes - Viewed (0) -
src/crypto/internal/boring/ecdh.go
} return bigBytesECDH(curve, big) } func bigBytesECDH(curve string, big *C.GO_BIGNUM) ([]byte, error) { out := make([]byte, curveSize(curve)) if C._goboringcrypto_BN_bn2bin_padded((*C.uint8_t)(&out[0]), C.size_t(len(out)), big) == 0 { return nil, fail("BN_bn2bin_padded") } return out, nil } func curveSize(curve string) int { switch curve { default:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 17:51:31 UTC 2023 - 6.2K bytes - Viewed (0)