Gen key

This pull request contains the changes that add support for symmetric key generation, as well some refactoring in `icsf.c` to make it possible to reuse some existing code.

I plan to add to this same pull request the changes for token-specific key generation as soon as I finish them. But I thought it might be a good idea to make this changes available for reviewing before that so we can try to avoid to accumulate reviews at the end of the sprint.