Changeset View
Changeset View
Standalone View
Standalone View
g10/keygen.c
| Context not available. | |||||
| curve = "Ed25519"; | curve = "Ed25519"; | ||||
| else if (!ascii_strcasecmp (curve, "cv448")) | else if (!ascii_strcasecmp (curve, "cv448")) | ||||
| curve = "X448"; | curve = "X448"; | ||||
| else if (!ascii_strcasecmp (curve, "ed448")) | |||||
| curve = "Ed448"; | |||||
| /* Note that we use the "comp" flag with EdDSA to request the use of | /* Note that we use the "comp" flag with EdDSA to request the use of | ||||
| a 0x40 compression prefix octet. */ | a 0x40 compression prefix octet. */ | ||||
| if (algo == PUBKEY_ALGO_EDDSA) | if (algo == PUBKEY_ALGO_EDDSA && !strcmp (curve, "Ed25519")) | ||||
| keyparms = xtryasprintf | keyparms = xtryasprintf | ||||
| ("(genkey(ecc(curve %zu:%s)(flags eddsa comp%s)))", | ("(genkey(ecc(curve %zu:%s)(flags eddsa comp%s)))", | ||||
| strlen (curve), curve, | strlen (curve), curve, | ||||
| (((keygen_flags & KEYGEN_FLAG_TRANSIENT_KEY) | (((keygen_flags & KEYGEN_FLAG_TRANSIENT_KEY) | ||||
| && (keygen_flags & KEYGEN_FLAG_NO_PROTECTION))? | && (keygen_flags & KEYGEN_FLAG_NO_PROTECTION))? | ||||
| " transient-key" : "")); | " transient-key" : "")); | ||||
| else if (algo == PUBKEY_ALGO_EDDSA && !strcmp (curve, "Ed448")) | |||||
| keyparms = xtryasprintf | |||||
| ("(genkey(ecc(curve %zu:%s)(flags comp%s)))", | |||||
| strlen (curve), curve, | |||||
| (((keygen_flags & KEYGEN_FLAG_TRANSIENT_KEY) | |||||
| && (keygen_flags & KEYGEN_FLAG_NO_PROTECTION))? | |||||
| " transient-key" : "")); | |||||
| else if (algo == PUBKEY_ALGO_ECDH && !strcmp (curve, "Curve25519")) | else if (algo == PUBKEY_ALGO_ECDH && !strcmp (curve, "Curve25519")) | ||||
| keyparms = xtryasprintf | keyparms = xtryasprintf | ||||
| ("(genkey(ecc(curve %zu:%s)(flags djb-tweak comp%s)))", | ("(genkey(ecc(curve %zu:%s)(flags djb-tweak comp%s)))", | ||||
| Context not available. | |||||
| { | { | ||||
| if (!strcmp (algostr, "ed25519")) | if (!strcmp (algostr, "ed25519")) | ||||
| kpi->algo = PUBKEY_ALGO_EDDSA; | kpi->algo = PUBKEY_ALGO_EDDSA; | ||||
| else if (!strcmp (algostr, "ed448")) | |||||
| kpi->algo = PUBKEY_ALGO_EDDSA; | |||||
| else if (!strcmp (algostr, "cv25519")) | else if (!strcmp (algostr, "cv25519")) | ||||
| kpi->algo = PUBKEY_ALGO_ECDH; | kpi->algo = PUBKEY_ALGO_ECDH; | ||||
| else if (!strcmp (algostr, "cv448")) | else if (!strcmp (algostr, "cv448")) | ||||
| Context not available. | |||||
| { | { | ||||
| if (!strcmp (algostr, "ed25519")) | if (!strcmp (algostr, "ed25519")) | ||||
| algo = PUBKEY_ALGO_EDDSA; | algo = PUBKEY_ALGO_EDDSA; | ||||
| else if (!strcmp (algostr, "ed448")) | |||||
| kpi->algo = PUBKEY_ALGO_EDDSA; | |||||
| else if (!strcmp (algostr, "cv25519")) | else if (!strcmp (algostr, "cv25519")) | ||||
| algo = PUBKEY_ALGO_ECDH; | algo = PUBKEY_ALGO_ECDH; | ||||
| else if (!strcmp (algostr, "cv448")) | else if (!strcmp (algostr, "cv448")) | ||||
| Context not available. | |||||
| * dsa2048 := DSA with 2048 bit. | * dsa2048 := DSA with 2048 bit. | ||||
| * elg2048 := Elgamal with 2048 bit. | * elg2048 := Elgamal with 2048 bit. | ||||
| * ed25519 := EDDSA using curve Ed25519. | * ed25519 := EDDSA using curve Ed25519. | ||||
| * ed448 := EDDSA using curve Ed448. | |||||
| * cv25519 := ECDH using curve Curve25519. | * cv25519 := ECDH using curve Curve25519. | ||||
| * cv448 := ECDH using curve X448. | * cv448 := ECDH using curve X448. | ||||
| * nistp256:= ECDSA or ECDH using curve NIST P-256 | * nistp256:= ECDSA or ECDH using curve NIST P-256 | ||||
| Context not available. | |||||