ch1-03.c 566 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Name : ch1-03.c
  3. * Purpose : Demonstration of variable length outputs
  4. * Author : Tom St Denis
  5. *
  6. * History : v0.79 Initial release
  7. */
  8. /* ch1-01-1 */
  9. #include <mycrypt.h>
  10. int main(void)
  11. {
  12. unsigned long length;
  13. unsigned char buffer[512];
  14. int errno;
  15. length = sizeof(buffer);
  16. if ((errno = some_func(..., buffer, &length)) != CRYPT_OK) {
  17. printf("Error: %s\n", error_to_string(errno));
  18. return EXIT_FAILURE;
  19. }
  20. printf("Size of output is %lu bytes\n", length);
  21. return 0;
  22. }
  23. /* ch1-01-1 */