]>
git.saurik.com Git - apple/xnu.git/blob - bsd/crypto/aes/Assert.c
1 /* This module exists solely to check compile-time assertions. It should be
2 compiled when building the project, and building should be terminated if
3 errors are encountered. However, any object it produces need not be
10 #include "crypto/aes.h"
13 /* Declare CheckAssertion so that if any of the declarations below differ
14 from it, the compiler will report an error.
16 extern char CheckAssertion
[1];
18 /* Ensure that ContextKey is the offset of the ks member of the AES context
21 extern char CheckAssertion
[ContextKey
== offsetof(aes_encrypt_ctx
, ks
)];
22 extern char CheckAssertion
[ContextKey
== offsetof(aes_decrypt_ctx
, ks
)];
23 /* If these assertions fail, change the definition of ContextKey in
24 Context.h to match the offset of the ks field.
27 /* Ensure that ContextKeyLength is the offset of the inf member of the AES
30 extern char CheckAssertion
[ContextKeyLength
== offsetof(aes_encrypt_ctx
, inf
)];
31 extern char CheckAssertion
[ContextKeyLength
== offsetof(aes_decrypt_ctx
, inf
)];
32 /* If these assertions fail, change the definition of ContextKeyLength in
33 Context.h to match the offset of the inf field.