Initialize a 'confidential' asset or 'confidential' nonce from an unsigned char array from a 'rawElementsTransaction'. * * Precondition: NULL != conf; * unsigned char rawConf[33] or rawConf == NULL; */
| 29 | * unsigned char rawConf[33] or rawConf == NULL; |
| 30 | */ |
| 31 | static void copyRawConfidential(confidential* conf, const unsigned char* rawConf) { |
| 32 | if (rawConf) { |
| 33 | *conf = (confidential){ .prefix = 0x01 == rawConf[0] ? EXPLICIT |
| 34 | : 0x01 == (0x01 & rawConf[0]) ? ODD_Y |
| 35 | : EVEN_Y |
| 36 | }; |
| 37 | sha256_toMidstate(conf->data.s, &rawConf[1]); |
| 38 | } else { |
| 39 | *conf = (confidential){0}; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /* Initialize a 'confAmount' from an unsigned char array from a 'rawElementsTransaction'. |
| 44 | * |
no test coverage detected