-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typo branching for k test file check number of args before using lua stack
- Loading branch information
1 parent
74e16df
commit a553d2a
Showing
4 changed files
with
35 additions
and
1 deletion.
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
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,30 @@ | ||
P256 = require('p256') | ||
|
||
alice_sk = P256.keygen() | ||
I.spy(alice_sk) | ||
alice_pk = P256.pubgen(alice_sk) | ||
I.spy(alice_pk) | ||
|
||
print(' DSA SIGN/VERIFY') | ||
|
||
local m = O.from_str([[ | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do | ||
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad | ||
minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in | ||
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla | ||
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum.]]) | ||
print 'iterate at least 100 tests of sign/verify' | ||
print 'and at least 1 tests with r or s length lower than 32 bytes' | ||
local tot = 0 | ||
|
||
while (tot<100) do | ||
sig = P256.sign(alice_sk, m) | ||
assert(P256.verify(alice_pk, sig, m), "ecdh verify failed") | ||
assert(not P256.verify(alice_pk, sig, sha256(m)), "ecdh verify failed") | ||
tot = tot+1 | ||
end | ||
|
||
print "OK" | ||
|
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