Skip to content

Commit 373e8a0

Browse files
author
blackshirt
committed
add docs
1 parent 2e6c5e4 commit 373e8a0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const (
6363
```
6464

6565

66-
[[Return to contents]](#Contents)
66+
6767

6868
```v
6969
const (
@@ -75,7 +75,7 @@ const (
7575

7676
This const for Curve25519 based curve
7777

78-
[[Return to contents]](#Contents)
78+
7979

8080
## x25519
8181
```v
@@ -88,7 +88,7 @@ The functions take a scalar and a u-coordinate as inputs and produce a u-coordin
8888
Although the functions work internally with integers, the inputs and outputs are 32-byte strings (for X25519) scalar can be generated at random, for example with `crypto.rand` and point should
8989
be either base_point or the output of another `x25519` call.
9090

91-
[[Return to contents]](#Contents)
91+
9292

9393
## Curve
9494
```v
@@ -110,7 +110,7 @@ Basically, Curve is a TLS 1.3 NamedGroup.
110110
its defined here for simplicity.
111111
vfmt off
112112

113-
[[Return to contents]](#Contents)
113+
114114

115115
## new_key_exchanger
116116
```v
@@ -119,7 +119,7 @@ fn new_key_exchanger(c Curve) !KeyExchanger
119119

120120
new_key_exchanger creates new KeyExchanger for curve c, for this time, only curve25519 is supported
121121

122-
[[Return to contents]](#Contents)
122+
123123

124124
## KeyExchanger
125125
```v
@@ -143,7 +143,7 @@ interface KeyExchanger {
143143

144144
Key Exchange Protocol
145145

146-
[[Return to contents]](#Contents)
146+
147147

148148
## PublicKey
149149
## equal
@@ -154,7 +154,7 @@ fn (pk PublicKey) equal(x PublicKey) bool
154154
equal tell if two PublicKey is equal, its check if has the same curve and its also check
155155
if underlying pubkey bytes has exactly the same length and contents.
156156

157-
[[Return to contents]](#Contents)
157+
158158

159159
## bytes
160160
```v
@@ -163,7 +163,7 @@ fn (pk PublicKey) bytes() ![]u8
163163

164164
bytes returns bytes content of PublicKey.
165165

166-
[[Return to contents]](#Contents)
166+
167167

168168
## PrivateKey
169169
## bytes
@@ -173,7 +173,7 @@ fn (pv PrivateKey) bytes() ![]u8
173173

174174
bytes return PrivateKey as a bytes array
175175

176-
[[Return to contents]](#Contents)
176+
177177

178178
## equal
179179
```v
@@ -182,7 +182,7 @@ fn (pv PrivateKey) equal(oth PrivateKey) bool
182182

183183
equal whether two PrivateKey has equally identical (its not check pubkey part)
184184

185-
[[Return to contents]](#Contents)
185+
186186

187187
## public_key
188188
```v
@@ -192,7 +192,7 @@ fn (mut prv PrivateKey) public_key() !PublicKey
192192
public_key is accessor for `privatekey.pubk` public key part, its does check if matching public key part or initializes PublicKey if not. Initialization is does under `sync.do_with_param`
193193
to make sure its that a function is executed only once.
194194

195-
[[Return to contents]](#Contents)
195+
196196

197197
## new_x25519_key_exchanger
198198
```v
@@ -201,7 +201,7 @@ fn new_x25519_key_exchanger() KeyExchanger
201201

202202
new_x25519_key_exchanger creates new Curve25519 based ECDH key exchange protocol
203203

204-
[[Return to contents]](#Contents)
204+
205205

206206
## Ecdh25519
207207
## curve_id
@@ -211,7 +211,7 @@ fn (ec Ecdh25519) curve_id() Curve
211211

212212
return underlying curve id
213213

214-
[[Return to contents]](#Contents)
214+
215215

216216
## private_key_size
217217
```v
@@ -220,7 +220,7 @@ fn (ec Ecdh25519) private_key_size() int
220220

221221
private_key_size returns private key size, in bytes
222222

223-
[[Return to contents]](#Contents)
223+
224224

225225
## public_key_size
226226
```v
@@ -229,7 +229,7 @@ fn (ec Ecdh25519) public_key_size() int
229229

230230
public_key_size returns public key size, in bytes
231231

232-
[[Return to contents]](#Contents)
232+
233233

234234
## private_key_from_key
235235
```v
@@ -238,7 +238,7 @@ fn (ec Ecdh25519) private_key_from_key(key []u8) !PrivateKey
238238

239239
private_key_from_key generates PrivateKey from seeded key.
240240

241-
[[Return to contents]](#Contents)
241+
242242

243243
## generate_private_key
244244
```v
@@ -247,7 +247,7 @@ fn (ec Ecdh25519) generate_private_key() !PrivateKey
247247

248248
generate_private_key generates PrivateKey with random entropy using `crypto.rand`
249249

250-
[[Return to contents]](#Contents)
250+
251251

252252
## public_key
253253
```v
@@ -256,7 +256,7 @@ fn (ec Ecdh25519) public_key(pv PrivateKey) !PublicKey
256256

257257
public_key gets PublicKey part of PrivateKey
258258

259-
[[Return to contents]](#Contents)
259+
260260

261261
## shared_secret
262262
```v
@@ -266,7 +266,7 @@ fn (ec Ecdh25519) shared_secret(local PrivateKey, remote PublicKey) ![]u8
266266
shared_secret computes shared keys between two parties, alice private keys and others public keys.
267267
Its commonly used as elliptic curve diffie-hellman (ECDH) key exchange protocol
268268

269-
[[Return to contents]](#Contents)
269+
270270

271271
## verify
272272
```v
@@ -276,4 +276,4 @@ fn verify(ec KeyExchanger, privkey PrivateKey, pubkey PublicKey) bool
276276
given PrivateKey privkey, verify do check whether given PublicKey pubkey is really keypair for privkey. Its check by calculating public key part of
277277
given PrivateKey.
278278

279-
[[Return to contents]](#Contents)
279+

0 commit comments

Comments
 (0)