Skip to content

Commit

Permalink
use PrngClassPointerConst in curve25519 file
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Aug 1, 2024
1 parent 8d3992b commit 3f8f52a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libp2p/crypto/curve25519.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ proc public*(private: Curve25519Key): Curve25519Key =
proc random*(_: type[Curve25519Key], rng: var HmacDrbgContext): Curve25519Key =
var res: Curve25519Key
let defaultBrEc = ecGetDefault()
let len = ecKeygen(addr rng.vtable, defaultBrEc, nil, addr res[0], EC_curve25519)
let len = ecKeygen(
PrngClassPointerConst(addr rng.vtable), defaultBrEc, nil, addr res[0], EC_curve25519
)
# Per bearssl documentation, the keygen only fails if the curve is
# unrecognised -
doAssert len == Curve25519KeySize, "Could not generate curve"
Expand Down

0 comments on commit 3f8f52a

Please sign in to comment.