Initialize a 'confAmount' from an unsigned char array from a 'rawElementsTransaction'. * * Precondition: NULL != amt; * unsigned char rawAmt[rawAmt[0] == 0x01 ? 9 : 33] or rawAmt == NULL */
| 46 | * unsigned char rawAmt[rawAmt[0] == 0x01 ? 9 : 33] or rawAmt == NULL |
| 47 | */ |
| 48 | static void copyRawAmt(confAmount* amt, const unsigned char* rawAmt) { |
| 49 | if (rawAmt) { |
| 50 | if (0x01 == rawAmt[0]) { |
| 51 | amt->prefix = EXPLICIT; |
| 52 | amt->explicit = ReadBE64(&rawAmt[1]); |
| 53 | } else { |
| 54 | amt->prefix = 0x01 == (0x01 & rawAmt[0]) ? ODD_Y : EVEN_Y; |
| 55 | sha256_toMidstate(amt->confidential.s, &rawAmt[1]); |
| 56 | } |
| 57 | } else { |
| 58 | amt->prefix = EXPLICIT; |
| 59 | amt->explicit = 0; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /* Initialize a 'sigInput' from a 'rawElementsInput', copying or hashing the data as needed. |
| 64 | * |
no test coverage detected