| 15 | |
| 16 | /// DER Length |
| 17 | size_t DERLengthEncode(BufferedTransformation &bt, lword length) |
| 18 | { |
| 19 | size_t i=0; |
| 20 | if (length <= 0x7f) |
| 21 | { |
| 22 | bt.Put(byte(length)); |
| 23 | i++; |
| 24 | } |
| 25 | else |
| 26 | { |
| 27 | bt.Put(byte(BytePrecision(length) | 0x80)); |
| 28 | i++; |
| 29 | for (int j=BytePrecision(length); j; --j) |
| 30 | { |
| 31 | bt.Put(byte(length >> (j-1)*8)); |
| 32 | i++; |
| 33 | } |
| 34 | } |
| 35 | return i; |
| 36 | } |
| 37 | |
| 38 | bool BERLengthDecode(BufferedTransformation &bt, lword &length, bool &definiteLength) |
| 39 | { |
no test coverage detected