mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
* don't use a temp for addr fix #19497 * Update compiler/ccgcalls.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * add a test Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
23 lines
487 B
Nim
23 lines
487 B
Nim
discard """
|
|
matrix: "--mm:arc; --mm:orc"
|
|
"""
|
|
|
|
block:
|
|
type
|
|
PublicKey = array[32, uint8]
|
|
PrivateKey = array[64, uint8]
|
|
|
|
proc ed25519_create_keypair(publicKey: ptr PublicKey; privateKey: ptr PrivateKey) =
|
|
publicKey[][0] = uint8(88)
|
|
|
|
type
|
|
KeyPair = object
|
|
public: PublicKey
|
|
private: PrivateKey
|
|
|
|
proc initKeyPair(): KeyPair =
|
|
ed25519_create_keypair(result.public.addr, result.private.addr)
|
|
|
|
let keys = initKeyPair()
|
|
doAssert keys.public[0] == 88
|