You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
643 B
13 lines
643 B
from imwald.core.nip49 import decrypt_ncryptsec, encrypt_to_ncryptsec |
|
|
|
|
|
def test_nip49_vector() -> None: |
|
nc = "ncryptsec1qgg9947rlpvqu76pj5ecreduf9jxhselq2nae2kghhvd5g7dgjtcxfqtd67p9m0w57lspw8gsq6yphnm8623nsl8xn9j4jdzz84zm3frztj3z7s35vpzmqf6ksu8r89qk5z2zxfmu5gv8th8wclt0h4p" |
|
sk = decrypt_ncryptsec(nc, "nostr") |
|
assert sk.hex() == "3501454135014541350145413501453fefb02227e449e57cf4d3a3ce05378683" |
|
|
|
|
|
def test_nip49_roundtrip() -> None: |
|
sk = bytes.fromhex("3501454135014541350145413501453fefb02227e449e57cf4d3a3ce05378683") |
|
nc = encrypt_to_ncryptsec(sk, "hunter2", log_n=16) |
|
assert decrypt_ncryptsec(nc, "hunter2") == sk
|
|
|