aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-12-08 17:09:07 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-08 17:09:07 -0800
commit8501bedd7508ac514385806e191aec21ee978891 (patch)
tree1b6c31139a71f80245c09597c343936a8e41d021
parenta545127fbccef4ee674d18d43732ce00ba97f782 (diff)
downloadbitcoin-8501bedd7508ac514385806e191aec21ee978891.tar.xz
Squashed 'src/crypto/ctaes/' changes from cd3c3ac..003a4ac
003a4ac Merge #5: fix typo 5254f14 [trivial] Fix typo e7c0aab Merge #4: Fix some comments d07cead Fix some comments git-subtree-dir: src/crypto/ctaes git-subtree-split: 003a4acfc273932ab8c2e276cde3b4f3541012dd
-rw-r--r--ctaes.c8
-rw-r--r--test.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/ctaes.c b/ctaes.c
index 2389fc0bb2..55962bf252 100644
--- a/ctaes.c
+++ b/ctaes.c
@@ -134,7 +134,7 @@ static void SubBytes(AES_state *s, int inv) {
D = U7;
}
- /* Non-linear transformation (identical to the code in SubBytes) */
+ /* Non-linear transformation (shared between the forward and backward case) */
M1 = T13 & T6;
M6 = T3 & T16;
M11 = T1 & T15;
@@ -469,9 +469,9 @@ static void AES_encrypt(const AES_state* rounds, int nrounds, unsigned char* cip
static void AES_decrypt(const AES_state* rounds, int nrounds, unsigned char* plain16, const unsigned char* cipher16) {
/* Most AES decryption implementations use the alternate scheme
- * (the Equivalent Inverse Cipher), which looks more like encryption, but
- * needs different round constants. We can't reuse any code here anyway, so
- * don't bother. */
+ * (the Equivalent Inverse Cipher), which allows for more code reuse between
+ * the encryption and decryption code, but requires separate setup for both.
+ */
AES_state s = {{0}};
int round;
diff --git a/test.c b/test.c
index fce1696acd..21439a16f1 100644
--- a/test.c
+++ b/test.c
@@ -102,7 +102,7 @@ int main(void) {
}
}
if (fail == 0) {
- fprintf(stderr, "All tests succesful\n");
+ fprintf(stderr, "All tests successful\n");
} else {
fprintf(stderr, "%i tests failed\n", fail);
}