mirror of
https://github.com/logos-storage/nim-bearssl.git
synced 2026-01-02 13:33:06 +00:00
* rsaKeygenGetDefault test * add ubuntu 24 and gcc 14 to ci * use PrngClassPointerConst for rsa keygen * fix test_brssl * add comment about ubuntu 24 * define and use ConstPtrPtrHashClass * remove previous ecKeygen * remove previous x509NoanchorInit * improve test * add ecKeygen test * add x509NoanchorInit test * remove commented code * rename target to linux-gcc-14 * test already exists * fix tests
21 lines
446 B
Nim
21 lines
446 B
Nim
import
|
|
unittest2,
|
|
../bearssl/[rand, ec]
|
|
|
|
{.used.}
|
|
|
|
type
|
|
EcPrivateKey* = ref object
|
|
buffer*: array[EC_KBUF_PRIV_MAX_SIZE, byte]
|
|
key*: ec.EcPrivateKey
|
|
|
|
suite "ec":
|
|
test "test ecKeygen interface":
|
|
let rng = HmacDrbgContext.new()
|
|
|
|
var ecimp = ecGetDefault()
|
|
var res = new EcPrivateKey
|
|
check ecKeygen(
|
|
PrngClassPointerConst(addr rng.vtable), ecimp, addr res.key, addr res.buffer[0], cint(EC_secp256r1)
|
|
) != 0
|