@@ -132,7 +132,7 @@ Data structures for key types and modes help the cryptolib recognize and prevent
132
132
133
133
#### Elliptic curve data structures
134
134
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 }}
136
136
137
137
#### Hash data structures
138
138
@@ -364,78 +364,95 @@ The two curves are birationally equivalent, in mathematical terms, so it is poss
364
364
365
365
For ECDSA, the cryptography library supports keypair generation, signing, and signature verification.
366
366
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 }}
373
374
374
375
#### ECDH
375
376
376
377
For ECDH (elliptic-curve Diffie-Hellman) key exchange, the cryptography library supports keypair generation and shared-key generation.
377
378
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.
378
379
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 }}
383
385
384
386
#### Ed25519
385
387
386
388
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.
387
389
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 }}
391
393
392
394
#### X25519
393
395
394
396
For x25519 key exchange, the cryptography library supports keypair generation and shared-key generation.
395
397
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.
396
398
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 }}
399
401
400
402
### ECC Asynchronous API
401
403
402
404
#### ECDSA
403
405
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 }}
414
423
415
424
#### ECDH
416
425
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 }}
423
437
424
438
#### Ed25519
425
439
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 }}
432
448
433
449
#### X25519
434
450
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 }}
439
456
440
457
## Deterministic random bit generation
441
458
0 commit comments