| Ed25519 sign / verify | sgcEd25519_Sign / sgcEd25519_Verify, sgcEd25519_PublicKey | RFC 8032. 32-byte public key, 64-byte signature. Verify rejects non-canonical points and S >= L per section 5.1.7. Signing is constant time in the secret scalar and in the per-message nonce: fixed four-bit windows, the table entry chosen by scanning all sixteen under a mask, and the complete addition formula of section 5.1.4. The public key comes from the 32-byte seed. |
| X25519 key exchange | sgcX25519, sgcX25519_PublicKey, sgcX25519_SharedSecret | RFC 7748 Diffie-Hellman over Curve25519. |
| Ed448 sign / verify | sgcEd448_GenerateKeyPair, sgcEd448_Sign, sgcEd448_Verify | RFC 8032, the 448-bit (Goldilocks) EdDSA curve. |
| X448 key exchange | sgcX448, sgcX448_PublicKey, sgcX448_SharedSecret | RFC 7748 Diffie-Hellman over Curve448. |
| secp256k1 | sgcECDSA_SignHash / VerifyHash with eccSecp256k1 | The Bitcoin/Ethereum curve, SEC 2, in sgcCrypto_ECCurves. |
| Brainpool P256r1 / P384r1 / P512r1 | same functions with eccBrainpoolP256r1 / P384r1 / P512r1 | RFC 5639, common in EU eIDAS and government profiles. |
| NIST P-256 / P-384 / P-521 | same functions with eccP256 / eccP384 / eccP521 | TsgcECCurve now names seven curves, so key generation, signing, verification, ECDH and point compression all reach the NIST prime curves from raw key bytes, not only from a PEM file. |
| Deterministic ECDSA nonce | built into sgcECDSA_SignHash | RFC 6979: the nonce is derived from the private key and message, no RNG failure mode. |
| Constant-time scalar multiplication | inside sgcECDSA_SignHash, sgcECDH_SharedSecret and EC key generation | Every curve in sgcCrypto_ECCurves runs the same engine: Montgomery reduction, which has no data-dependent step, a fixed window whose count comes from the curve, table entries chosen by scanning all of them under a mask, and a complete addition formula that never looks at a coordinate to decide which case applies. The JOSE, WebAuthn and E2EE paths of sgcCrypto_EC run the same code. |
| ECDH (secp256k1 / Brainpool) | sgcECDH_SharedSecret | Shared secret over the same four curves. |
| Point compression | sgcEC_Compress / sgcEC_Decompress | Store or transmit the shorter compressed public-key form. |
| EC as JWS (ES256/384/512) | sgcECDSA_SignJWS / sgcECDSA_VerifyJWS | Curve selected automatically from the requested bit length, sign/verify directly from a PEM key, JOSE-oriented sibling of ECCurves. |
| Generic ECDH | sgcECDH | Shared secret from a raw private key and peer public point. |
| Raw / DER ECDSA verify | sgcECDSA_VerifyRaw / sgcECDSA_VerifyDER | Verify against a raw (Qx, Qy, r, s) tuple or a DER-encoded signature. |
| DER ECDSA signing & conversion | sgcECDSA_SignDER / sgcECDSA_VerifyDER, sgcECDSA_RawToDER / sgcECDSA_DERToRaw | X.509, CMS and TLS carry the DER ECDSA-Sig-Value, a SEQUENCE of INTEGER r then INTEGER s. JOSE and WebAuthn carry the raw R || S pair instead. Sign straight into either form, or convert an existing signature between them. |
| Schnorr signatures (BIP-340) | sgcSchnorr_PublicKey, sgcSchnorr_Sign, sgcSchnorr_Verify | secp256k1 only, with x-only 32-byte public keys and 64-byte signatures: what Taproot, Nostr and Lightning use. sgcSchnorr_TaggedHash is exposed so the BIP-341 and BIP-342 tags can be built on the same construction. |
| RSA sign (PKCS#1 v1.5) | sgcRSA_SignPKCS1 | From a PEM private key, SHA-1/256/384/512 digest. |
| RSA private key operations | sgcRSA_SignPKCS1 and the other signing and decryption calls of sgcCrypto_RSA_Keys | Each operation is blinded with a fresh random pair, run through a fixed-window exponentiation and a CRT recombination whose timing does not depend on the factors or the data, and checked against the public exponent before the result is returned. A fault in one CRT half would otherwise give away a factor in a single signature, so on a mismatch nothing is returned. |
| RSA verify (PKCS#1 v1.5 / PSS) | sgcRSA_VerifyPKCS1, sgcRSA_VerifyPSS, and _Raw variants over a modulus/exponent | RFC 8017. Verify works from a PEM key or raw modulus and exponent, no key-object construction required. |
| RSA key generation | sgcRSA_GenerateKey | Any requested bit length, Miller-Rabin primality testing. |
| RSA-OAEP encryption | sgcRSA_OAEP_Encrypt / sgcRSA_OAEP_Decrypt | RFC 8017 optimal asymmetric encryption padding. |
| RSA-OAEP with an independent MGF1 hash | the five-parameter sgcRSA_OAEP_Encrypt / sgcRSA_OAEP_Decrypt overloads | Pin the label hash and the MGF1 hash separately. OAEPWithSHA256AndMGF1Padding means SHA-256 for both in Bouncy Castle but SHA-256 with MGF1-SHA1 in SunJCE, and that mismatch is the usual reason Java interoperability fails. |
| RSA PKCS#1 v1.5 encryption | sgcRSA_PKCS1_Encrypt / sgcRSA_PKCS1_Decrypt | RFC 8017 section 7.2, the mode Java names RSA/ECB/PKCS1Padding. Decrypt takes the same path for every failure so it gives a padding oracle nothing to work with. Prefer OAEP for anything new. |
| RSA-PSS / PKCS#1 signing | sgcRSA_PSS_Sign / Verify, sgcRSA_PKCS1_Sign / Verify | Sign directly from a generated TsgcRSAPrivateKey. |
| RSA key export | sgcRSA_ExportPrivateKeyPEM, sgcRSA_ExportPublicKeyPEM, matching DER calls | PKCS#1 and SubjectPublicKeyInfo encodings. |
| PKCS#8 and SEC 1 key export | sgcRSA_ExportPrivateKeyPKCS8DER / PKCS8PEM, sgcEC_ExportPrivateKeyPKCS8DER / PKCS8PEM, sgcEC_ExportPrivateKeySEC1DER / SEC1PEM, sgcEC_ExportSubjectPublicKeyInfo, sgcEC_ExportPublicKeyPEM | The BEGIN PRIVATE KEY container Java, .NET and most modern tooling expect, alongside the SEC 1 BEGIN EC PRIVATE KEY form and the SubjectPublicKeyInfo a certificate embeds. Unencrypted, so what comes back is bare key material. |
| RSA and EC key import | sgcRSA_ImportPrivateKeyDER / PEM, sgcRSA_ImportPublicKeyDER / PEM, sgcEC_ImportPrivateKeyDER / PEM, sgcEC_ImportPublicKeyDER / PEM | This did not exist before: a generated key could be written out but never read back in. Import accepts PKCS#1, PKCS#8, SEC 1 and SubjectPublicKeyInfo, DER or PEM, recomputes the CRT parameters or the public point when the file omits them, and returns False on malformed input rather than raising, so untrusted files are safe to hand it. |
| ECIES seal / open | sgcECIES_GenerateKeyPair, sgcECIES_Seal, sgcECIES_Open | Hybrid encryption to an X25519 public key: ephemeral ECDH plus an AEAD, one call each way. |