diff options
| -rw-r--r-- | drivers/crypto/amcc/crypto4xx_alg.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c index 4092c2aad8e2..3458c5a085d9 100644 --- a/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c | |||
| @@ -141,9 +141,10 @@ static int crypto4xx_setkey_aes(struct crypto_skcipher *cipher, | |||
| 141 | /* Setup SA */ | 141 | /* Setup SA */ |
| 142 | sa = ctx->sa_in; | 142 | sa = ctx->sa_in; |
| 143 | 143 | ||
| 144 | set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ? | 144 | set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_ECB ? |
| 145 | SA_SAVE_IV : SA_NOT_SAVE_IV), | 145 | SA_NOT_SAVE_IV : SA_SAVE_IV), |
| 146 | SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, | 146 | SA_NOT_LOAD_HASH, (cm == CRYPTO_MODE_ECB ? |
| 147 | SA_LOAD_IV_FROM_SA : SA_LOAD_IV_FROM_STATE), | ||
| 147 | SA_NO_HEADER_PROC, SA_HASH_ALG_NULL, | 148 | SA_NO_HEADER_PROC, SA_HASH_ALG_NULL, |
| 148 | SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO, | 149 | SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO, |
| 149 | SA_OP_GROUP_BASIC, SA_OPCODE_DECRYPT, | 150 | SA_OP_GROUP_BASIC, SA_OPCODE_DECRYPT, |
| @@ -162,6 +163,11 @@ static int crypto4xx_setkey_aes(struct crypto_skcipher *cipher, | |||
| 162 | memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); | 163 | memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); |
| 163 | sa = ctx->sa_out; | 164 | sa = ctx->sa_out; |
| 164 | sa->sa_command_0.bf.dir = DIR_OUTBOUND; | 165 | sa->sa_command_0.bf.dir = DIR_OUTBOUND; |
| 166 | /* | ||
| 167 | * SA_OPCODE_ENCRYPT is the same value as SA_OPCODE_DECRYPT. | ||
| 168 | * it's the DIR_(IN|OUT)BOUND that matters | ||
| 169 | */ | ||
| 170 | sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT; | ||
| 165 | 171 | ||
| 166 | return 0; | 172 | return 0; |
| 167 | } | 173 | } |
