I can't say I disagree with the "dive into the deeper end of the pool to see if you drown" approach, but it is likely to be brutal for most.
@Gandado and @poteto have you covered on the primary inquiry, but for your most recent, I'll focus on:
(uint8_t **pubKey, uint32_t &pubLen, uint8_t **priKey, uint32_t &priLen)
This isn't "just" two unsigned ints. It is, however, the signature of a strange mixture of very old "C" style and the C++ (due to the references).
The overall intent, it seems, is that pubKey and priKey ultimately represent two arrays of unsigned 8 bit characters, each with a length expressed by the related pubLen and priLen. So, no, it isn't just two unsigned ints, but two unsigned 8 bit arrays of undetermined length.
That said, the use of "**" (sometimes, in this context, said to be a pointer to a pointer) is intended to allow the function this declares to allocate the array to be returned. To do that they use the "C" style of "**", such that the function can assign the calling code's pointer when the array is allocated, where it is thus intended that the caller will provide the address of an uin8_t *, perhaps something like:
1 2 3 4 5 6
|
uint8_t * pubkey{};
uint32_t publen{};
uint8_t * prikey{};
uint32_t prilen {};
f( &pubkey, publen, &prikey, prilen );
| |
This assumes your signature if for the function "f".
Whatever "f" ultimately does, it can allocate and assign pubkey and prikey to new arrays, where their lengths are assigned to publen and prilen respectively.
It is very non-C++, even pre 21st century. You do occasionally find such material when using older libraries, which implies we don't have control or authorship of "f", but in this context it is a bit confusing to me because of the "&" used on the lengths. If this were genuinely a "C" function, those would be pointers to uint8_t types instead of references.
Even then, it would be simpler, conceptually, to use uint8_t *& for the array parameters, so as to avoid the double de-reference implication for the array assignments in the function, but that's a minor point.
The real flaw is that these parameter pairs aren't an object.
Which of these stated subject materials are not familiar to you?
basic Linux system operation
inheritance
polymorphism
interfaces
abstract classes
dynamic linking
functional objects/lambdas
basic memory management
...and how long do you have to complete the assignment?
As an early course assignment this sounds like the teacher wants a break, so he's dishing out something that would take a while, so he can nap through it.
That, or he's going to hope this causes several to give up and drop out of the course.
There's were I don't like the idea, because I'm not in favor of such things, but the practice of software development always has had an element of that "dive into the deep end of the pool", and it has never let up. We're frequently confronted with new, complicated, intertwined problems to solve, and getting everyone accustomed to that early on seems like a "boot camp" style exercise toward "the real thing".
_