Skip to content

Commit 5af110d

Browse files
committed
[crypto] Update documentation after splitting ECC API.
Signed-off-by: Jade Philipoom <jadep@zerorisc.com>
1 parent 78eccb1 commit 5af110d

File tree

1 file changed

+59
-42
lines changed

1 file changed

+59
-42
lines changed

doc/security/cryptolib/cryptolib_api.md

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Data structures for key types and modes help the cryptolib recognize and prevent
132132

133133
#### Elliptic curve data structures
134134

135-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_eddsa_sign_mode }}
135+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_eddsa_sign_mode }}
136136

137137
#### Hash data structures
138138

@@ -364,78 +364,95 @@ The two curves are birationally equivalent, in mathematical terms, so it is poss
364364

365365
For ECDSA, the cryptography library supports keypair generation, signing, and signature verification.
366366

367-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_keygen }}
368-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_keygen }}
369-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_sign }}
370-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_sign }}
371-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_verify }}
372-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_verify }}
367+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_keygen }}
368+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_sign }}
369+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_verify }}
370+
371+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_keygen }}
372+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_sign }}
373+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_verify }}
373374

374375
#### ECDH
375376

376377
For ECDH (elliptic-curve Diffie-Hellman) key exchange, the cryptography library supports keypair generation and shared-key generation.
377378
Each party should generate a key pair, exchange public keys, and then generate the shared key using their own private key and the other party's public key.
378379

379-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p256_keygen }}
380-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p384_keygen }}
381-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p256 }}
382-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p384 }}
380+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256_keygen }}
381+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256 }}
382+
383+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384_keygen }}
384+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384 }}
383385

384386
#### Ed25519
385387

386388
For Ed25519 (a curve-specialized version of EdDSA, the Edwards curve digital signature algorithm), the cryptography library supports keypair generation, signature generation, and signature verification.
387389

388-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_keygen }}
389-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_sign }}
390-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_verify }}
390+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_keygen }}
391+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_sign }}
392+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_verify }}
391393

392394
#### X25519
393395

394396
For x25519 key exchange, the cryptography library supports keypair generation and shared-key generation.
395397
Each party should generate a key pair, exchange public keys, and then generate the shared key using their own private key and the other party's public key.
396398

397-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519_keygen }}
398-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519 }}
399+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519_keygen }}
400+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519 }}
399401

400402
### ECC Asynchronous API
401403

402404
#### ECDSA
403405

404-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_keygen_async_start }}
405-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_keygen_async_finalize }}
406-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_keygen_async_start }}
407-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_keygen_async_finalize }}
408-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_sign_async_start }}
409-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_sign_async_finalize }}
410-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_sign_async_start }}
411-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p384_sign_async_finalize }}
412-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_verify_async_start }}
413-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdsa_p256_verify_async_finalize }}
406+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_keygen_async_start }}
407+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_keygen_async_finalize }}
408+
409+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_sign_async_start }}
410+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_sign_async_finalize }}
411+
412+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_verify_async_start }}
413+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdsa_p256_verify_async_finalize }}
414+
415+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_keygen_async_start }}
416+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_keygen_async_finalize }}
417+
418+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_sign_async_start }}
419+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_sign_async_finalize }}
420+
421+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_verify_async_start }}
422+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdsa_p384_verify_async_finalize }}
414423

415424
#### ECDH
416425

417-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p256_keygen_async_start }}
418-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p384_keygen_async_finalize }}
419-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p256_async_start }}
420-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p256_async_finalize }}
421-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p384_async_start }}
422-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ecdh_p384_async_finalize }}
426+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256_keygen_async_start }}
427+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256_keygen_async_finalize }}
428+
429+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256_async_start }}
430+
{{#header-snippet sw/device/lib/crypto/include/ecc_p256.h otcrypto_ecdh_p256_async_finalize }}
431+
432+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384_keygen_async_start }}
433+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384_keygen_async_finalize }}
434+
435+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384_async_start }}
436+
{{#header-snippet sw/device/lib/crypto/include/ecc_p384.h otcrypto_ecdh_p384_async_finalize }}
423437

424438
#### Ed25519
425439

426-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_keygen_async_start }}
427-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_keygen_async_finalize }}
428-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_sign_async_start }}
429-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_sign_async_finalize }}
430-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_verify_async_start }}
431-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_ed25519_verify_async_finalize }}
440+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_keygen_async_start }}
441+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_keygen_async_finalize }}
442+
443+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_sign_async_start }}
444+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_sign_async_finalize }}
445+
446+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_verify_async_start }}
447+
{{#header-snippet sw/device/lib/crypto/include/ed25519.h otcrypto_ed25519_verify_async_finalize }}
432448

433449
#### X25519
434450

435-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519_keygen_async_start }}
436-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519_keygen_async_finalize }}
437-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519_async_start }}
438-
{{#header-snippet sw/device/lib/crypto/include/ecc.h otcrypto_x25519_async_finalize }}
451+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519_keygen_async_start }}
452+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519_keygen_async_finalize }}
453+
454+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519_async_start }}
455+
{{#header-snippet sw/device/lib/crypto/include/x25519.h otcrypto_x25519_async_finalize }}
439456

440457
## Deterministic random bit generation
441458

0 commit comments

Comments
 (0)