summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2022-09-15 11:04:32 +0200
committerRaul Santos <raulsntos@gmail.com>2022-09-15 11:39:03 +0200
commitd76250016479546730db23dac27333e7d531b3e5 (patch)
treeed177f919fc01c954a6cf83d1f858f65dad4a78f /doc
parent20d6672846b3fd1537603ac080116dcc914c10e3 (diff)
Fix invalid C# in crypto docs
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/AESContext.xml1
-rw-r--r--doc/classes/HMACContext.xml18
2 files changed, 10 insertions, 9 deletions
diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml
index 69cd54a79b..7f582e4be7 100644
--- a/doc/classes/AESContext.xml
+++ b/doc/classes/AESContext.xml
@@ -45,6 +45,7 @@
public class Example : Node
{
public AESContext Aes = new AESContext();
+
public override void _Ready()
{
string key = "My secret key!!!"; // Key must be either 16 or 32 bytes.
diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml
index 52d4fce28f..706ee30963 100644
--- a/doc/classes/HMACContext.xml
+++ b/doc/classes/HMACContext.xml
@@ -32,22 +32,22 @@
public class CryptoNode : Node
{
private HMACContext ctx = new HMACContext();
+
public override void _Ready()
{
- PackedByteArray key = String("supersecret").to_utf8();
- Error err = ctx.Start(HashingContext.HASH_SHA256, key);
- GD.Assert(err == OK);
- PackedByteArray msg1 = String("this is ").to_utf8();
- PackedByteArray msg2 = String("super duper secret").to_utf8();
+ byte[] key = "supersecret".ToUTF8();
+ Error err = ctx.Start(HashingContext.HashType.Sha256, key);
+ Debug.Assert(err == Error.Ok);
+ byte[] msg1 = "this is ".ToUTF8();
+ byte[] msg2 = "super duper secret".ToUTF8();
err = ctx.Update(msg1);
- GD.Assert(err == OK);
+ Debug.Assert(err == Error.Ok);
err = ctx.Update(msg2);
- GD.Assert(err == OK);
- PackedByteArray hmac = ctx.Finish();
+ Debug.Assert(err == Error.Ok);
+ byte[] hmac = ctx.Finish();
GD.Print(hmac.HexEncode());
}
}
-
[/csharp]
[/codeblocks]
</description>