forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use a temp for addr [backport: 1.6] (nim-lang#19503)
* don't use a temp for addr fix nim-lang#19497 * Update compiler/ccgcalls.nim Co-authored-by: konsumlamm <[email protected]> * add a test Co-authored-by: konsumlamm <[email protected]>
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 |