2018-12-23 18:29:39 -05:00
|
|
|
! Copyright (C) 2018 Alexander Ilin.
|
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
|
USING: arrays io.encodings.string io.encodings.utf8 kernel math
|
|
|
|
|
sequences sodium tools.test ;
|
|
|
|
|
IN: sodium.tests
|
|
|
|
|
|
|
|
|
|
{ t } [
|
|
|
|
|
"Encrypted message" dup utf8 encode
|
|
|
|
|
crypto-box-nonce 2 [ crypto-box-keypair 2array ] times
|
|
|
|
|
[ [ first ] [ second ] bi* crypto-box-easy ] 3keep swap
|
|
|
|
|
[ first ] [ second ] bi* crypto-box-open-easy utf8 decode =
|
|
|
|
|
] unit-test
|
2019-04-14 09:17:06 -04:00
|
|
|
|
|
|
|
|
{ t } [
|
|
|
|
|
"Signature verification test" utf8 encode
|
2020-04-07 01:52:29 -04:00
|
|
|
crypto-sign-keypair
|
|
|
|
|
[ nip crypto-sign ]
|
|
|
|
|
[ drop crypto-sign-verify ] 3bi
|
2019-04-14 09:17:06 -04:00
|
|
|
] unit-test
|