Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 101 for Curve (0.04 sec)

  1. 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)
  2. 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)
  3. src/crypto/ecdsa/ecdsa_s390x_test.go

    	curves := [...]elliptic.Curve{
    		elliptic.P256(),
    		elliptic.P384(),
    		elliptic.P521(),
    	}
    
    	for _, curve := range curves {
    		name := curve.Params().Name
    		t.Run(name, func(t *testing.T) { testKeyGeneration(t, curve) })
    		t.Run(name, func(t *testing.T) { testSignAndVerify(t, curve) })
    		t.Run(name, func(t *testing.T) { testNonceSafety(t, curve) })
    		t.Run(name, func(t *testing.T) { testINDCCA(t, curve) })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 834 bytes
    - Viewed (0)
  4. src/crypto/ecdsa/ecdsa_legacy.go

    // This file contains a math/big implementation of ECDSA that is only used for
    // deprecated custom curves.
    
    func generateLegacy(c elliptic.Curve, rand io.Reader) (*PrivateKey, error) {
    	k, err := randFieldElement(c, rand)
    	if err != nil {
    		return nil, err
    	}
    
    	priv := new(PrivateKey)
    	priv.PublicKey.Curve = c
    	priv.D = k
    	priv.PublicKey.X, priv.PublicKey.Y = c.ScalarBaseMult(k.Bytes())
    	return priv, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  5. src/crypto/x509/pkcs8_test.go

    			t.Errorf("%s: decoded PKCS#8 returned unexpected key type: %T", test.name, privKey)
    			continue
    		}
    		if ecKey, isEC := privKey.(*ecdsa.PrivateKey); isEC && ecKey.Curve != test.curve {
    			t.Errorf("%s: decoded PKCS#8 returned unexpected curve %#v", test.name, ecKey.Curve)
    			continue
    		}
    		reserialised, err := MarshalPKCS8PrivateKey(privKey)
    		if err != nil {
    			t.Errorf("%s: failed to marshal into PKCS#8: %s", test.name, err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Nov 19 16:45:10 UTC 2022
    - 9K bytes
    - Viewed (0)
  6. internal/config/identity/openid/jwks.go

    			return nil, errMalformedJWKECKey
    		}
    
    		var curve elliptic.Curve
    		switch key.Crv {
    		case "P-224":
    			curve = elliptic.P224()
    		case "P-256":
    			curve = elliptic.P256()
    		case "P-384":
    			curve = elliptic.P384()
    		case "P-521":
    			curve = elliptic.P521()
    		default:
    			return nil, fmt.Errorf("Unknown curve type: %s", key.Crv)
    		}
    
    		xbuf, err := base64.RawURLEncoding.DecodeString(key.X)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Apr 02 23:02:35 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  7. src/crypto/internal/boring/ecdsa.go

    func curveNID(curve string) (C.int, error) {
    	switch curve {
    	case "P-224":
    		return C.GO_NID_secp224r1, nil
    	case "P-256":
    		return C.GO_NID_X9_62_prime256v1, nil
    	case "P-384":
    		return C.GO_NID_secp384r1, nil
    	case "P-521":
    		return C.GO_NID_secp521r1, nil
    	}
    	return 0, errUnknownCurve
    }
    
    func NewPublicKeyECDSA(curve string, X, Y BigInt) (*PublicKeyECDSA, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 17:51:31 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  8. security/pkg/pki/util/generate_csr.go

    	var priv any
    	var err error
    	if options.ECSigAlg != "" {
    		switch options.ECSigAlg {
    		case EcdsaSigAlg:
    			var curve elliptic.Curve
    			switch options.ECCCurve {
    			case P384Curve:
    				curve = elliptic.P384()
    			default:
    				curve = elliptic.P256()
    			}
    			priv, err = ecdsa.GenerateKey(curve, rand.Reader)
    			if err != nil {
    				return nil, nil, fmt.Errorf("EC key generation failed (%v)", err)
    			}
    		default:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 06 12:48:53 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  9. security/tools/generate_csr/main.go

    	keySize = flag.Int("key-size", 2048, "Size of the generated private key")
    	ec      = flag.String("ec-sig-alg", "", "Generate an elliptical curve private key with the specified algorithm")
    	curve   = flag.String("curve", "P256", "Specify the elliptic curve to use to generate an elliptical curve private key")
    )
    
    func saveCreds(csrPem []byte, privPem []byte) {
    	err := os.WriteFile(*outCsr, csrPem, 0o644)
    	if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  10. security/tools/generate_cert/main.go

    	isServer  = flag.Bool("server", false, "Whether this certificate is for a server.")
    	ec        = flag.String("ec-sig-alg", "", "Generate an elliptical curve private key with the specified algorithm")
    	curve     = flag.String("curve", "P256", "Specify the elliptic curve to use to generate an elliptical curve private key")
    	sanFields = flag.String("san", "", "Subject Alternative Names")
    )
    
    func checkCmdLine() {
    	flag.Parse()
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 28 16:21:30 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top