Add an 'confidential' value to be consumed by an ongoing SHA-256 evaluation. * If the 'confidential' value is blinded, then the 'evenPrefix' used if the y coordinate is even, * and the 'oddPrefix' is used if the y coordinate is odd. * If the 'confidential' value is explicit, then '0x01' is used as the prefix. * If the 'confidential' value is "NULL" then only '0x00' added. * * Precondition: N
| 10 | * NULL != conf; |
| 11 | */ |
| 12 | void simplicity_sha256_confidential(unsigned char evenPrefix, unsigned char oddPrefix, sha256_context* ctx, const confidential* conf) { |
| 13 | switch (conf->prefix) { |
| 14 | case NONE: sha256_uchar(ctx, 0x00); return; |
| 15 | case EXPLICIT: sha256_uchar(ctx, 0x01); break; |
| 16 | case EVEN_Y: sha256_uchar(ctx, evenPrefix); break; |
| 17 | case ODD_Y: sha256_uchar(ctx, oddPrefix); break; |
| 18 | } |
| 19 | sha256_hash(ctx, &conf->data); |
| 20 | } |
| 21 | |
| 22 | /* Add an 'confidential' asset to be consumed by an ongoing SHA-256 evaluation. |
| 23 | * |
no test coverage detected