crypto: avoid memory leak

Reviewed-By: Fedor Indutny <fedor@indutny.com>
crypto: unsigned value can't be negative

Reviewed-By: Fedor Indutny <fedor@indutny.com>