From af0e0506cbcbee969965091afc6d54e36dd98591 Mon Sep 17 00:00:00 2001 From: DannyNiu/NJF Date: Mon, 7 Oct 2024 19:01:22 +0800 Subject: [PATCH] Documented Incremental Signing. --- docs/api.html | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/docs/api.html b/docs/api.html index 49288ea..3bc07e4 100644 --- a/docs/api.html +++ b/docs/api.html @@ -1234,6 +1234,90 @@

DSS - Digital Signature Schemes

+

Incremental Signing / Pre-Hashing

+ +

+ Many existing digital signature schemes actually signs a hash digest + of the message. Those that does this including RSA (PKCS#1 v1.5 and PSS), + ECDSA, and some variants of EdDSA specified in RFC-8032. To realize their + full potential, incremental signing are devised. +

+ +
+
dssPreHashingType
+
+

+ The type of pre-hashing supported by the algorithm instance. + It can be one of the following enumerations: +

+
    +
  • dssPreHashing_Unsupported: + This algorithm does not support pre-hashing at all.
  • + +
  • dssPreHashing_Interface: + PrePre-hashing offered in an interface, and the algorithm behaves + the same as if the message is buffered and signed all-at-once.
  • + +
  • dssPreHashing_Variant: + Pre-hashing offered in an interface, but algorithm will behave + differently from that of buffering and signing all-at-once.
  • + +
  • dssPreHashing_ParamSet: + Pre-hashing is supported in a separate algorithm instance.
  • +
+

+
+ +
PKIncSignInitFunc
+
PKIncVerifyInitFunc
+
+

+ The initialization functions for incremental signing and + incremental verifying. They have the prototype: +

+
void *(*PKIncSignInitFunc_t)(rbuf x, UpdateFunc_t *placeback);
+        
+

This type has an alias: PKIncVerifyInitFunc_t.

+

+ When called, it initializes a hashing context and prepare it + with algorithm-specific prefix data. Before returning the pointer + to this working context, it places a pointer to the update function + of this hashing function into placeback. +

+
+ +
PKIncSignFinalFunc
+
+

+ The function that completes hashing of and produce a signature + for the hashed message, of the prototype: +

+
void *(*PKIncSignFinalFunc_t)(
+          rbuf x,
+          GenFunc_t prng_gen, rbuf prng);
+

where:

+
    +
  • x points to the private-key working context,
  • +
  • prng_gen is the PRNG + random bits generating function,
  • +
  • prng is the working context for the PRNG.
  • +
+
+ +
PKIncVerifyFinalFunc
+
+

+ The function that completes hashing and verifies the signature + of the hashed message, of the prototype: +

+
void *(*PKIncVerifyFinalFunc_t)(rbuf x);
+

where:

+
    +
  • x points to the public-key working context,
  • +
+
+
+

Miscellaneous Context Control Function