Skip to content

Commit

Permalink
fixup file perms; tests for crypto_sign and crypto_sign_detached
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Oct 1, 2015
1 parent 835fa30 commit f733f76
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 2 deletions.
Empty file modified Changes 100755 → 100644
Empty file.
Empty file modified MANIFEST 100755 → 100644
Empty file.
Empty file modified META.json 100755 → 100644
Empty file.
Empty file modified META.yml 100755 → 100644
Empty file.
Empty file modified Makefile.PL 100755 → 100644
Empty file.
Empty file modified README 100755 → 100644
Empty file.
Empty file modified README.md 100755 → 100644
Empty file.
Empty file modified Sodium.xs 100755 → 100644
Empty file.
Empty file modified lib/Crypt/Sodium.pm 100755 → 100644
Empty file.
Empty file modified ppport.h 100755 → 100644
Empty file.
14 changes: 12 additions & 2 deletions t/Crypt-Sodium.t 100755 → 100644
Expand Up @@ -38,7 +38,7 @@ is(crypto_box_open($enciphered, $n, $pk1, $sk2), $message, "Testing roundtrip of
is(crypto_hash($message), crypto_hash($message), "Testing hash comparison");
is(length(randombytes_buf(24)), 24, "Testing random bytes output");

# test new password hashing functionality
# test password hashing functionality
my $cleartext = "abc123";
my $salt = crypto_pwhash_salt;
my $key = crypto_pwhash_scrypt($cleartext, $salt);
Expand All @@ -48,4 +48,14 @@ my $hp = crypto_pwhash_scrypt_str($cleartext, $salt);
is(crypto_pwhash_scrypt_str_verify($hp, $cleartext), 1, "test crypto_pwhash_scrypt_str_verify positive");
is(crypto_pwhash_scrypt_str_verify($hp, $cleartext . "not"), undef, "test crypto_pwhash_scrypt_str_verify negative");

done_testing();
my ($spk, $ssk) = sign_keypair();
# test sigs
my $signed = crypto_sign($cleartext, $ssk);
is(crypto_sign_open($signed, $spk), $cleartext, "verifying crypto_sign signed message");

# test detached sigs
my $sig = crypto_sign_detached($cleartext, $ssk);
is(crypto_sign_verify_detached($sig, $cleartext, $spk), 1, "verifying crypto_sign_detached signature");

done_testing();

0 comments on commit f733f76

Please sign in to comment.