Question: In C Programming: Int40 *fibKw26(int n, Int40 *first, Int40 *second); Description: This is your Fibonacci function. Pay careful attention the F(0) is initialized with the

In C Programming:

Int40 *fibKw26(int n, Int40 *first, Int40 *second);

Description:

This is your Fibonacci function. Pay careful attention the F(0) is initialized with the hwConfigVariable and F(1) is initialized with the cryptoVariable. Implement an iterative solution that runs in O(n) time and returns a pointer to a Int40 struct that contains F(n). Be sure to prevent memory leaks before returning from this function. Space Consideration: When computing F(n) for large n, its important to keep as few Fibonacci numbers in memory as necessary at any given time. For example, in building up to F(10000), you wont want to hold Fibonacci numbers F(0) through F(9999) in memory all at once. Find a way to have only a few Fibonacci numbers in memory at any given time over the course of a single call to fibKw26(...).

Special Notes:

Remember that n is the second parameter passed as an input argument to the program. You may assume that n is a non-negative integer. If any dynamic memory allocation functions fail within this function, return NULL, but be careful to avoid memory leaks when you do so. Returns:

A pointer to an Int40 representing F(n), or NULL if dynamic memory allocation fails.

In C Programming Int40 *encrypt(Int40 *key, Int40 *inputText);

Description:

This is the encryption function. It will take the inputText pointer and XOR the inputText data with the key that had been generated using the fibKw26 function. This process will produce an encrypted message. Special Notes: It is interesting to note that encrypted data can produce the original plain text by simply XORing the encrypted data with the key, which this assignment demonstrates can be reproduced on demand.

Returns:

A pointer to an Int40 representing the encrypted plain text.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!