I found the following code here:
class Cipher {
...
};
#define TC_TRIAL(NAME, BLOCK_SIZE, KEY_SIZE) \
class TC_JOIN (Cipher,NAME) : public Cipher { \
...\
}
TC_CIPHER (AES, 16, 32);
I am aware that this is a macro and that (NAME, BLOCK_SIZE, KEY_SIZE)
are additional parameters, but after the preprocessor replaces any corresponding occurrences of the parameters in the replacement list, we should get something like this, I gather:
class TC_JOIN (Cipher,AES) : public Cipher {
...
}
The TC_JOIN (Cipher,AES)
slightly baffles me (especially the addition of the parentheses part). Would you be so kind as to explain to me what exactly this syntactic structure is supposed to mean?
TC_JOIN
is defined in VeraCrypt/src/Platform/PlatformBase.h:
#define TC_JOIN_ARGS(a,b) a##b
#define TC_JOIN(a,b) TC_JOIN_ARGS(a,b)
It concatenates the two parameter.
When you are not sure what a symbol means, then search for its definition. I saw that Cipher.h
(the header you quote from) includes Crypto/config.h
and Platform/Platform.h
. When I realized that Platform.h
is a header that merely includes loads of other headers I gave up on that route and used the github search to find all occurences of TC_JOIN
. One of them was #define TC_JOIN ...
. There you go.