You may use any resource that existed prior to this exam opening, including websites, books, etc; but should not consult friends, tutors, forums, or other interactive help for this exam.
You must not share any information about this exam (even how you felt about it) with any party (even others who have taken it) until after it closes at 2020-04-06 23:59 EDT.
The following are all of the form "inverting ____ requires". To invert function f we mean, given f(m), compute m. Assume that
Inverting a cryptographically secure hash requires
Inverting a public-key encryption requires
Inverting a private-key encryption requires
Inverting a symmetric-key encryption requires
Untrusted agent U sends me a message M and a message signature S created by agent A using public key K.
Which of the following should I definitely not get from U?
This question has been dropped because of an ambiguity in its wording. The intent was to suggest that if U is my witness that K belongs to A, then U can simply give me U's public key instead of A's public key. Unfortunately, I failed to mention that K was not part of a certificate, and since certificates are commonly used to allow U to give me K in practice the question became too vague to measure learning.
Assume
Give C-syntax Boolean expression, like M == Y(H(M),K)
, which is true if and only if the message was signed by A.
The following discuss caches
Large cache blocks improve cache performance when the code exhibits
Set-associative caches are used instead of fully-associative caches because set-associative caches
Set-associative caches are used instead of direct-mapped caches because set-associative caches
Which code has better locality?
Assume i
and j
are stored in registers and a
is a 10,000-element array.
Because 1009 is prime, the following will set all 1009 elements of a
to 0 as long as x
is not a multiple of 1009
:
for(int i=0; i<1009; i+=1)
a[(i*x)%1009] = 0;
Consider x
values 2, 31, and 505. Order these values from slowest to fastest assuming we have a
a
can fit in a single cache blockAssume that the (i*x)%1009
takes the same number of cycles regardless of the values of i
and x
.
For 2, we access items 0, 2, 4, 6, 8, .... That gives us 1 cold miss, then 1 hit, then 1 cold miss, etc: 50% hit rate.
For 31, we access items 0, 31, 62, 93, ...., 992, 43, 74, 85, ... That means every read is a miss, and even once we wrap around we'd on new blocks: 0% hit rate.
For 505, we access items 0, 505, 1, 506, 2, 507, .... Two misses, then size hits; 2 misses then 6 hits, etc: 75% hit rate.
In your TLB code, you had no block offset because there was just one entry per block. We had just one entry per block because
If you have 52-bit addresses cached in a 16MB 8-way set-associative L2 cache with 64-byte blocks
The set index is how many bits? Answer as a base-10 integer
The block offset is how many bits? Answer as a base-10 integer
The tag is how many bits? Answer as a C expression that evaluates to the correct number. You may use
52
bob
(the number of block offset bits)sib
(the number of set index bits)log2(n)
the log-base-2 of n
+
, -
, *
, /
, and <<
The following ask about threading
When running in user mode,
We often say that "each thread has its own stack memory"; we mean that each
In a multi-threaded environment, which of the following pairs of instructions always runs atomically; that is, that the result of running them is the same as if no other instructions were run in between them?
I eat a meal consisting of a bowl of soup and a bowl of ice cream, using the same spoon for both.
Which of the following is concurrent but not parallel?
Which of the following is parallel but not concurrent?
A memory leak in a process is limited to that process: when the process terminates, all its allocated memory will be reclaimed (that is, deallocated and made available to other processes).
How is process memory reclaimed?
If a thread has a memory leak,
The following ask about several synchronization primitives
Which of the following is commonly used to create a simple blocking mutex?
Which of the following does not block: that is, it never suspends a thread?
The x86 instruction lock cmpxchg
is a hardware implementation of which of the following?
Which of the following ensure that my code has no deadlocks?