xiaoxiang781216 commented on code in PR #10260:
URL: https://github.com/apache/nuttx/pull/10260#discussion_r1299186728
##########
crypto/xform.c:
##########
@@ -638,6 +684,109 @@ int aes_xts_setkey(FAR void *sched, FAR uint8_t *key, int
len)
return 0;
}
+void aes_ofb_encrypt(caddr_t key, FAR uint8_t *data)
+{
+ FAR struct aes_ofb_ctx *ctx;
+ int i;
+
+ ctx = (FAR struct aes_ofb_ctx *)key;
+
+ aes_encrypt(&ctx->ac_key, ctx->iv, ctx->iv);
+ for (i = 0; i < AESOFB_IVSIZE; i++)
+ {
+ data[i] ^= ctx->iv[i];
+ }
+}
+
+int aes_ofb_setkey(FAR void *sched, FAR uint8_t *key, int len)
+{
+ FAR struct aes_ctr_ctx *ctx;
Review Comment:
```suggestion
FAR struct aes_ofb_ctx *ctx;
```
##########
crypto/xform.c:
##########
@@ -638,6 +684,109 @@ int aes_xts_setkey(FAR void *sched, FAR uint8_t *key, int
len)
return 0;
}
+void aes_ofb_encrypt(caddr_t key, FAR uint8_t *data)
+{
+ FAR struct aes_ofb_ctx *ctx;
+ int i;
+
+ ctx = (FAR struct aes_ofb_ctx *)key;
+
+ aes_encrypt(&ctx->ac_key, ctx->iv, ctx->iv);
+ for (i = 0; i < AESOFB_IVSIZE; i++)
+ {
+ data[i] ^= ctx->iv[i];
+ }
+}
+
+int aes_ofb_setkey(FAR void *sched, FAR uint8_t *key, int len)
+{
+ FAR struct aes_ctr_ctx *ctx;
+
+ ctx = (FAR struct aes_ctr_ctx *)sched;
Review Comment:
```suggestion
ctx = (FAR struct aes_ofb_ctx *)sched;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]