enc_tail.c 553 B

12345678910111213141516171819202122232425262728
  1. if (srclen-- == 0) {
  2. break;
  3. }
  4. *o++ = plain64_base64_table_enc[*c >> 2];
  5. st.carry = (*c++ << 4) & 0x30;
  6. st.bytes++;
  7. outl += 1;
  8. case 1: if (srclen-- == 0) {
  9. break;
  10. }
  11. *o++ = plain64_base64_table_enc[st.carry | (*c >> 4)];
  12. st.carry = (*c++ << 2) & 0x3C;
  13. st.bytes++;
  14. outl += 1;
  15. case 2: if (srclen-- == 0) {
  16. break;
  17. }
  18. *o++ = plain64_base64_table_enc[st.carry | (*c >> 6)];
  19. *o++ = plain64_base64_table_enc[*c++ & 0x3F];
  20. st.bytes = 0;
  21. outl += 2;
  22. }
  23. }
  24. state->bytes = st.bytes;
  25. state->carry = st.carry;
  26. *outlen = outl;