Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for Curve (0.16 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/crypto/ecdsa/ecdsa_s390x.go

    // the name of the curve to see if it matches the curves supported(P-256, P-384, P-521).
    // Then, based on the curve name, a function code and a block size will be assigned.
    // If KDSA instruction is not available or if the curve is not supported, canUseKDSA
    // will set ok to false.
    func canUseKDSA(c elliptic.Curve) (functionCode uint64, blockSize int, ok bool) {
    	if testingDisableKDSA {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  10. src/crypto/x509/boring.go

    	default:
    		return false
    	case *rsa.PublicKey:
    		if size := k.N.BitLen(); size != 2048 && size != 3072 && size != 4096 {
    			return false
    		}
    	case *ecdsa.PublicKey:
    		if k.Curve != elliptic.P256() && k.Curve != elliptic.P384() && k.Curve != elliptic.P521() {
    			return false
    		}
    	}
    	return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 22:52:27 UTC 2024
    - 993 bytes
    - Viewed (0)
Back to top