Skip to content

Commit

Permalink
Potential optimization for IdToCurve
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Aug 13, 2024
1 parent fdc81e2 commit c34d24a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/FCryptoEC_Prime.uc
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,14 @@ static final function int RunCode(
return R;
}

static final function CurveParams IdToCurve(EFCEllipticCurve Curve)
// Differs from C version: const out param for performance.
// TODO: benchmark the actual difference when this has a return value struct.
static final function IdToCurve(
EFCEllipticCurve Curve,
const out CurveParams out_CurveParams
)
{
return default._PP[Curve - FCEC_Secp256r1];
out_CurveParams = default._PP[Curve - FCEC_Secp256r1];
};

static function array<byte> Generator(EFCEllipticCurve Curve, out int Len)
Expand Down

0 comments on commit c34d24a

Please sign in to comment.