File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/utils/crypto/test Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 verify ,
2323 verifySignatureSecp256k1 ,
2424} from "../src/index.js" ;
25+ import * as cryptoRoot from "../src/index.js" ;
2526import { PreHash } from "../src/prehash.js" ;
2627
2728describe ( "Ed25519" , ( ) => {
@@ -90,6 +91,15 @@ describe("Ed25519", () => {
9091 ) ;
9192 expect ( isNotVerified ) . to . be . false ;
9293 } ) ;
94+
95+ it ( "exports verifyPrepared from the root entrypoint" , async ( ) => {
96+ const keypair = await Ed25519Keypair . create ( ) ;
97+ const data = new Uint8Array ( [ 1 , 2 , 3 ] ) ;
98+ const signature = await keypair . sign ( data , PreHash . SHA_256 ) ;
99+ expect ( cryptoRoot . verifyPrepared ) . to . be . a ( "function" ) ;
100+ const prepared = await cryptoRoot . prehashFn ( data , signature . prehash ) ;
101+ expect ( await cryptoRoot . verifyPrepared ( signature , prepared ) ) . to . be . true ;
102+ } ) ;
93103 } ) ;
94104
95105 describe ( "browser" , ( ) => {
You can’t perform that action at this time.
0 commit comments