nim-bearssl/tests/test_ec.nim
diegomrsantos d4e2f555c8
gcc 14 support (#62)
* 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
2024-07-18 18:50:24 +03:00

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