@@ -146,6 +146,9 @@ const msg = new TextEncoder().encode('hello');
146
146
const sig = ed25519 .sign (msg , priv );
147
147
ed25519 .verify (sig , msg , pub ); // Default mode: follows ZIP215
148
148
ed25519 .verify (sig , msg , pub , { zip215: false }); // RFC8032 / FIPS 186-5
149
+
150
+ // Variants from RFC8032: with context, prehashed
151
+ import { ed25519ctx , ed25519ph } from ' @noble/curves/ed25519' ;
149
152
```
150
153
151
154
Default ` verify ` behavior follows [ ZIP215] ( https://zips.z.cash/zip-0215 ) and
@@ -158,9 +161,6 @@ and additionally provides [non-repudiation with SBS](#edwards-twisted-edwards-cu
158
161
X25519 follows [ RFC7748] ( https://www.rfc-editor.org/rfc/rfc7748 ) .
159
162
160
163
``` ts
161
- // Variants from RFC8032: with context, prehashed
162
- import { ed25519ctx , ed25519ph } from ' @noble/curves/ed25519' ;
163
-
164
164
// ECDH using curve25519 aka x25519
165
165
import { x25519 } from ' @noble/curves/ed25519' ;
166
166
const priv = ' a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4' ;
@@ -249,8 +249,6 @@ DecafPoint.hashToCurve(shake256(msg, { dkLen: 112 }));
249
249
hashToDecaf448 (msg , { DST: ' decaf448_XOF:SHAKE256_D448MAP_RO_' });
250
250
```
251
251
252
- Same RFC7748 / RFC8032 / IRTF draft are followed.
253
-
254
252
#### bls12-381
255
253
256
254
``` ts
0 commit comments