repo
stringclasses
341 values
file_path
stringlengths
29
173
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.66M
tokens
int64
2
598k
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Checksums/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ CRC32 = require("@self/CRC32"), Adler = require("@self/Adler") }) return Algorithms
35
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/ChaCha.luau
luau
.luau
--[=[ Cryptography library: ChaCha20 Sizes: Nonce: 12/24 bytes Key: 16/32 bytes Return type: buffer Example usage: local Data = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Nonce = buffer.fromstring(string.rep("n", 12)) --------Usage Case 1-------- l...
5,680
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/Poly1305.luau
luau
.luau
--[=[ Cryptography library: Poly1305 Sizes: Key: 32 bytes Tag: 16 bytes Return type: buffer Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Tag = Poly1305(Message, Key) --]=] --!strict --!optimize 2 --!native local TAG_SIZE ...
2,497
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/AEAD/init.luau
luau
.luau
--[=[ Cryptography library: ChaCha20-Poly1305 AEAD Sizes: Key: 16/32 bytes Nonce: 12/24 bytes Tag: 16 bytes Rounds: even positive integer (default: 20) Return type: buffer, buffer (ciphertext, tag) Example usage: local Plaintext = buffer.fromstring("Hello World") local Key = buffer.fromstring(string...
2,117
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/AES.luau
luau
.luau
--[=[ Cryptography library: AES Sizes: Init Vector: 16 bytes Key Size: 16 / 24 / 32 bytes Example usage: local Key = CSPRNG.RandomBytes(32) local IV = CSPRNG.RandomBytes(12) local Message = "This is a secret message" local Plaintext = buffer.fromstring(Message) local AAD = buffer.fromstring("user:john...
11,019
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/Simon.luau
luau
.luau
--[=[ Cryptography library: Simon Cipher 64-bit ⚠️ WARNING: Simon is not very secure! For security, use AES or CHACHA20. ⚠️ Sizes: Key: 16 bytes Return type: buffer Example Usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring("MySecretKey12345") local Encrypted = Enc...
2,088
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/Speck.luau
luau
.luau
--[=[ Cryptography library: Speck ⚠️ WARNING: Speck is not very secure! For security, use AES or CHACHA20. ⚠️ Sizes: Key: 8 bytes Return type: buffer Example Usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring("Key") local Encrypted = Encrypt(Message, Key) local De...
2,257
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/XOR.luau
luau
.luau
--[=[ Cryptography library: XOR Symmetric Cipher ⚠️ WARNING: XOR is not cryptographically secure! Do not use the same key twice! For security, use AES or CHACHA20. ⚠️ Return type: buffer Example Usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring("MySecretKey12345") -- Fas...
839
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Encryption/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ AEAD = require("@self/AEAD"), AES = require("@self/AES"), XOR = require("@self/XOR"), Simon = require("@self/Simon"), Speck = require("@self/Speck") }) return Algorithms
62
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/Blake2b.luau
luau
.luau
--[=[ Cryptography library: BLAKE2b Return type: string Example usage: local Message = buffer.fromstring("Hello World") -- BLAKE2b-128 (128-bit output) local Result128 = BLAKE2b(Message, 16) -- BLAKE2b-256 (256-bit output) local Result256 = BLAKE2b(Message, 32) -- BLAKE2b-384 (384-bit output) ...
8,620
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/Blake3.luau
luau
.luau
--[=[ Cryptography library: Blake3 Sizes: Key: 32 bytes Output: variable Return type: string (hex) Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) --------Standard Hash-------- local Hash = Blake3.Digest(Message, 32) --------...
5,225
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/HKDF/HMAC.luau
luau
.luau
--[=[ Cryptography library: HMAC Return type: string or function Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring("Key") local BlockSize = 64 -- SHA256 block length (= string.len(SHA256(...))) local Result = HMAC(Message, Key, SHA2.SHA256, BlockSize) -- SHA3/...
726
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/HKDF/init.luau
luau
.luau
--[=[ Cryptography library: HKDF (HMAC-based Key Derivation Function) RFC 5869 extract-then-expand key derivation built on HMAC. Return type: buffer Example usage: local IKM = buffer.fromstring("input key material") local OKM = HKDF(IKM, Salt, Info, 32, SHA2.SHA256, 64, 32) --]=] --!strict --!optimize 2 --!n...
611
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/KMAC.luau
luau
.luau
--[=[ Cryptography library: KMAC (Keccak Message Authentication Code) KMAC128 and KMAC256 are keyed hash functions based on cSHAKE128 and cSHAKE256. They give variable length output and strong authentication. Unlike SHAKE and cSHAKE, changing the output length generates a new, unrelated output. Both variants s...
9,312
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/MD5.luau
luau
.luau
--[=[ Cryptography library: MD5 ⚠️ WARNING: MD5 is cryptographically broken! Only use for legacy compatibility, checksums, or non-security purposes. For security, use SHA256 or higher. ⚠️ Return type: string Usage: local Message = buffer.fromstring("Hello World") local Result = MD5(Message) --]=] --!stri...
1,996
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/Murmur.luau
luau
.luau
--[=[ Cryptography library: MurmurHash3-32 ⚠️ WARNING: MurmurHash3 wasn't designed with cryptographic security in mind! Only use for non-security purposes like hash tables or hyperloglog. For security, use SHA256 or higher. ⚠️ MurmurHash3 is a fast non-cryptographic hash that is well-distributed. Return type...
1,248
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA1.luau
luau
.luau
--[=[ Cryptography library: SHA1 ⚠️ WARNING: SHA1 is cryptographically broken! Only use for legacy compatibility, checksums, or non-security purposes. For security, use SHA256 or higher. ⚠️ Sizes: Digest: 20 bytes Return type: string Example usage: local Message = buffer.fromstring("Hello World") -...
1,268
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA224.luau
luau
.luau
--[=[ Cryptography library: SHA224 Sizes: Digest: 28 bytes Return type: string Example usage: local Message = buffer.fromstring("Hello World") local Result = SHA224(Message) --]=] --!strict --!optimize 2 --!native local CONSTANTS = buffer.create(256) do -- CONSTANTS = k local RoundConstants = { 0x428a...
1,815
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA256.luau
luau
.luau
--[=[ Cryptography library: SHA256 Sizes: Digest: 32 bytes Return type: string Example usage: local Message = buffer.fromstring("Hello World") local Result = SHA256(Message) --]=] --!strict --!optimize 2 --!native local CONSTANTS = buffer.create(256) do -- CONSTANTS = k local RoundConstants = { 0x428a2...
1,847
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA384.luau
luau
.luau
--[=[ Cryptography library: SHA384 Sizes: Digest: 48 bytes Return type: (string, buffer) Example usage: local Message = buffer.fromstring("Hello World") local Hash, HashBuffer = SHA384(Message) --]=] --!strict --!optimize 2 --!native local K_HI = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c2...
4,903
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/SHA512.luau
luau
.luau
--[=[ Cryptography library: SHA512 Sizes: Digest: 64 bytes Return type: (string, buffer) Example usage: local Message = buffer.fromstring("Hello World") local Hash, HashBuffer = SHA512(Message) --]=] --!strict --!optimize 2 --!native local K_HI = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c2...
5,062
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA2/init.luau
luau
.luau
--[[ Cryptography library: SHA2 Family --]] return { SHA224 = require("@self/SHA224"), SHA256 = require("@self/SHA256"), SHA384 = require("@self/SHA384"), SHA512 = require("@self/SHA512"), }
59
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/SHA3.luau
luau
.luau
--[=[ Cryptography library: Keccak/SHA-3 Sizes: SHA3-224 Digest: 28 bytes SHA3-256 Digest: 32 bytes SHA3-384 Digest: 48 bytes SHA3-512 Digest: 64 bytes SHAKE128 Digest: variable SHAKE256 Digest: variable Return type: string Example usage: local Message = buffer.fromstring("Hello World") local ...
7,716
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/XXH32.luau
luau
.luau
--[=[ Cryptography library: XXHash32 ⚠️ WARNING: XXHash32 wasn't designed with cryptographic security in mind! Only use for non-security purposes. For security, use SHA256 or higher. ⚠️ Return type: number Example usage: local Message = buffer.fromstring("Hello World") --------Usage Case 1-------- local...
2,006
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Hashing/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ HMAC = require("@self/HMAC"), HKDF = require("@self/HKDF"), KMAC = require("@self/KMAC"), MD5 = require("@self/MD5"), SHA1 = require("@self/SHA1"), SHA2 = require("@self/SHA2"), SHA3 = require("@self/SHA3"), XXH32 = require("@self/XXH32"), Blake2b = require("@self/B...
133
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/Base64.luau
luau
.luau
--[=[ Cryptography library: Base64 Return type: buffer Example usage: local Input = buffer.fromstring("Hello World") local Encoded = Base64.Encode(Input) local Decoded = Base64.Decode(Encoded) --]=] --!strict --!optimize 2 --!native local PADDING_CHARACTER = 61 local ALPHABET_BYTES = buffer.create(64) do ...
3,196
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/Blake3.luau
luau
.luau
--[=[ Cryptography library: Blake3 Sizes: Key: 32 bytes Output: variable Return type: string (hex) Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) --------Standard Hash-------- local Hash = Blake3.Digest(Message, 32) --------...
3,393
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/ChaCha20.luau
luau
.luau
--[=[ Cryptography library: ChaCha20 Sizes: Nonce: 12 bytes Key: 16/32 bytes Return type: buffer Example usage: local Data = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Nonce = buffer.fromstring(string.rep("n", 12)) --------Usage Case 1-------- loca...
3,274
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/Conversions.luau
luau
.luau
--[=[ Cryptography library: Conversions Return type: string / buffer Example Usage: local HexString = Conversions.ToHex(buffer.fromstring("Hello World")) local OriginalBuffer = Conversions.FromHex("48656c6c6f20576f726c64") --]=] --!strict --!optimize 2 --!native local ENCODE_LOOKUP = buffer.create(256 * 2) d...
1,625
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/CSPRNG/init.luau
luau
.luau
--[=[ Cryptography library: Cryptographically Secure RNG Usage: local RandomFloat = CSPRNG.Random() local RandomInt = CSPRNG.RandomInt(1, 100) local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5) local RandomBytes = CSPRNG.RandomBytes(32) local RandomHex = CSPRNG.RandomHex(16) local FastString = CSPRNG.R...
5,064
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/RandomString.luau
luau
.luau
--[=[ Cryptography library: Random String Generator ⚠️WARNING: This is not using cryptographically secure random numbers. For Security use CSPRNG.⚠️ Return type: string | buffer Example Usage: local String = RandomString(500) --]=] --!strict --!optimize 2 --!native local function RandomString(Length: numb...
159
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Utilities/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ RandomString = require("@self/RandomString"), Conversions = require("@self/Conversions"), Base64 = require("@self/Base64"), CSPRNG = require("@self/CSPRNG") }) return Algorithms
55
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/Blake3.luau
luau
.luau
--[=[ Cryptography library: Blake3 Sizes: Key: 32 bytes Output: variable Return type: string (hex) Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) --------Standard Hash-------- local Hash = Blake3.Digest(Message, 32) --------...
3,543
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/ChaCha20.luau
luau
.luau
--[=[ Cryptography library: ChaCha20 Sizes: Nonce: 12 bytes Key: 16/32 bytes Return type: buffer Example usage: local Data = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Nonce = buffer.fromstring(string.rep("n", 12)) --------Usage Case 1-------- loca...
3,202
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/CSPRNG/init.luau
luau
.luau
--[=[ Cryptography library: Cryptographically Secure RNG Usage: local RandomFloat = CSPRNG.Random() local RandomInt = CSPRNG.RandomInt(1, 100) local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5) local RandomBytes = CSPRNG.RandomBytes(32) local RandomHex = CSPRNG.RandomHex(16) local FastString = CSPRNG.R...
5,064
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/Curve25519.luau
luau
.luau
--[=[ Cryptography library: Curve25519 Montgomery Return type: varies by function Example usage: local Curve25519 = require("Curve25519") local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Point multiplication-------- local BasePoint = Curve25519.G local SomeScalar = FieldQuadratic.De...
2,818
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/Edwards25519.luau
luau
.luau
--[=[ Cryptography library: Edwards25519 Return type: varies by function Example usage: local Edwards = require("Edwards25519") local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Point addition-------- local Point1 = Edwards.Decode(SomeEncodedBuffer) local Point2 = Edwards.Decode(Anot...
11,461
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/FieldPrime.luau
luau
.luau
--[=[ Cryptography library: Field Prime (Curve25519 Base Field) Return type: varies by function Example usage: local FieldPrime = require("FieldPrime") --------Usage Case 1: Basic arithmetic-------- local ElementA = FieldPrime.Num(42) local ElementB = FieldPrime.Num(17) local Sum = FieldPrime.Add(Element...
12,113
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/FieldQuadratic.luau
luau
.luau
--[=[ Cryptography library: Field Quadratic (Curve25519 Scalar Field) Return type: varies by function Example usage: local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Basic scalar arithmetic-------- local ScalarA = FieldQuadratic.Decode(SomeBytes) local ScalarB = FieldQuadratic.Decode(...
3,927
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/MultiPrecision.luau
luau
.luau
--[=[ Cryptography library: Multi-Precision Arithmetic (264-bit integers) Return type: varies by function Example usage: local MultiPrecision = require("MultiPrecision") --------Usage Case 1: Basic arithmetic-------- local NumberA = MultiPrecision.Num(42) local NumberB = MultiPrecision.Num(17) local Sum ...
5,898
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/SHA512.luau
luau
.luau
--!strict --!optimize 2 --!native local K_HI = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5...
4,655
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/EdDSA/X25519.luau
luau
.luau
--[=[ Cryptography library: X25519 with cofactor clearing Return type: varies by function Example usage: local AlicePrivate = CSPRNG.Ed25519Random() local BobPrivate = CSPRNG.Ed25519Random() local AliceMasked = X25519.Mask(AlicePrivate) local BobMasked = X25519.Mask(BobPrivate) local AlicePublic = X2551...
2,513
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/CSPRNG/init.luau
luau
.luau
--[=[ Cryptography library: Cryptographically Secure RNG Usage: local RandomFloat = CSPRNG.Random() local RandomInt = CSPRNG.RandomInt(1, 100) local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5) local RandomBytes = CSPRNG.RandomBytes(32) local RandomHex = CSPRNG.RandomHex(16) local FastString = CSPRNG.R...
5,064
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Field.luau
luau
.luau
--[=[ Finite field arithmetic modulo Q = 8380417 Arithmetic operations over the prime field Z_q where q = 2^23 - 2^13 + 1. All operations maintain elements in canonical form [0, Q). Example usage: local Field = require(script) local A = 12345 local B = 67890 local Sum = Field.Add(A, B) local Product...
451
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/NTT.luau
luau
.luau
--[=[ Number Theoretic Transform for degree-255 polynomials Forward and inverse NTT over Z_q for polynomial multiplication. Uses Cooley-Tukey and Gentleman-Sande algorithms with precomputed roots. Example usage: local NTT = require(script) local Poly = buffer.create(256 * 4) -- 256 coefficients, 4 bytes ...
1,459
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Pack.luau
luau
.luau
--[=[ Bit packing and unpacking utilities Serializes polynomials to byte arrays with various bit widths. Supports encoding/decoding of polynomial coefficients and hint bits. Example usage: local BitPacking = require(script) local Poly = buffer.create(256 * 4) local Encoded = buffer.create(96) -- For 3-b...
5,403
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Params.luau
luau
.luau
--[=[ Parameter validation for ML-DSA algorithms FIPS 204 specification. Example usage: local Params = require(script) local IsValid = Params.CheckKeygenParams(4, 4, 13, 2) -- ML-DSA-44 local ValidEta = Params.CheckEta(2) --]=] --!strict --!optimize 2 --!native local Q = 8380417 local Params = {} fun...
993
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/PolyVec.luau
luau
.luau
--[=[ Vector operations on degree-255 polynomials Works on vectors of polynomials including matrix multiplication, NTT transforms, and encoding/decoding for ML-DSA. Example usage: local PolyVec = require(script) local Vec = buffer.create(4 * 256 * 4) -- 4 polynomials PolyVec.ForwardNTT(Vec, 4) local N...
9,419
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/SHA3.luau
luau
.luau
--!strict --!optimize 2 --!native local SHA3 = {} local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do local HighFactorKeccak = 0 local ShiftRegister = 29 local function GetNextBit(): number local Result = ShiftRegister % 2 ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result...
6,803
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Sampling.luau
luau
.luau
--[=[ ML-DSA Sampling Example usage: local Sampling = require(script) local Rho = buffer.create(32) local Matrix = buffer.create(4 * 4 * 256 * 4) Sampling.ExpandA(Rho, Matrix, 4, 4) --]=] --!strict --!optimize 2 --!native local XOF = require("./XOF") local Params = require("./Params") local N = 256 lo...
4,853
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/Utils.luau
luau
.luau
--[=[ Utility functions for ML-DSA key and signature sizes ML-DSA parameters. Example usage: local Utils = require(script) local PubKeySize = Utils.PubKeyLen(4, 13) -- 1312 bytes for ML-DSA-44 local SecKeySize = Utils.SecKeyLen(4, 4, 2, 13) -- 2560 bytes local SigSize = Utils.SigLen(4, 4, 131072, 80, ...
448
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/XOF.luau
luau
.luau
--[=[ Stateful SHAKE XOF (Extensible Output Function) Non-OOP implementation with reusable state buffers. For ML-DSA sampling functions that use rejection sampling. Example usage: local XOF = require(script) XOF.Reset128() XOF.Absorb128(message) local Chunk1 = XOF.Squeeze128(168) local Chunk2 = XOF...
8,128
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlDSA/init.luau
luau
.luau
--[=[ ML-DSA (FIPS 204) Digital Signature Algorithm Post quantum digital signature scheme based on lattice cryptography. Has three security levels: ML-DSA-44, ML-DSA-65, ML-DSA-87. Example usage: local MLDSA = require("@self/MlDSA") local PubKey, SecKey = MLDSA.ML_DSA_44.GenerateKeys() local Message = b...
7,249
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Compression.luau
luau
.luau
--[=[ ML-KEM Compression Module Polynomial coefficient compression and decompression operations for ML-KEM. Maps field elements to and from reduced bit representations. --]=] --!strict --!optimize 2 --!native local Params = require("./Params") local N = 256 local Q = 3329 local Compression = {} function Compr...
1,449
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Field.luau
luau
.luau
--[=[ ML-KEM Field Arithmetic Module Prime field Zq arithmetic operations for ML-KEM. Modular arithmetic over the field Z_q where q = 3329. Example usage: local Field = require(script.Field) local Sum = Field.Add(1234, 567) local Product = Field.Multiply(1234, 567) local Inverse = Field.Invert(1234) ...
511
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/NTT.luau
luau
.luau
--[=[ ML-KEM Number Theoretic Transform Module Number Theoretic Transform (NTT) operations for polynomial multiplication. Cooley-Tukey NTT and Gentleman-Sande inverse NTT algorithms Example usage: local NTT = require(script.NTT) local Poly = buffer.create(512) -- 256 coefficients * 2 bytes NTT.Ntt(Pol...
3,057
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/PKE.luau
luau
.luau
--[=[ ML-KEM Public Key Encryption Module K-PKE (CPA-secure public key encryption) implementation for ML-KEM. Provides key generation, encryption, and decryption operations as specified in NIST FIPS 203. Example usage: local PKE = require(script.PKE) local Seed = buffer.fromstring("32_byte_seed_here..."...
2,481
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Params.luau
luau
.luau
--[=[ ML-KEM Parameters Module Parameter validation functions for ML-KEM. NIST FIPS 203 specification. Example usage: local Params = require(script.Params) local IsValid = Params.CheckKeygenParams(4, 2) -- true local ValidD = Params.CheckD(11) -- true local ValidEncrypt = Params.CheckEncryptParams(4,...
722
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/PolyVec.luau
luau
.luau
--[=[ ML-KEM Polynomial Vector Module Polynomial vector and matrix operations for ML-KEM. Vector arithmetic, matrix multiplication, and encoding/decoding operations on vectors of degree-255 polynomials. --]=] --!strict --!optimize 2 --!native local Ntt = require("./NTT") local MlKemParams = require("./Params") ...
1,569
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/SHA3.luau
luau
.luau
--!strict --!optimize 2 --!native local SHA3 = {} local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do local HighFactorKeccak = 0 local ShiftRegister = 29 local function GetNextBit(): number local Result = ShiftRegister % 2 ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result...
6,832
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Sampling.luau
luau
.luau
--[=[ ML-KEM Sampling Module Polynomial sampling operations for ML-KEM. Uniform sampling from Rq and centered binomial distribution sampling. Example usage: local Sampling = require(script.Sampling) local Rho = buffer.create(32) local Matrix = Sampling.GenerateMatrix(3, Rho, false) local Sigma = ...
1,932
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Serialize.luau
luau
.luau
--[=[ ML-KEM Serialization Module Polynomial encoding and decoding operations for ML-KEM. Converts polynomials to/from byte arrays with different bit lengths. Example usage: local Serialize = require(script.Serialize) local Poly = buffer.create(512) -- 256 coefficients local Encoded = Serialize.Encode...
4,688
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/Utils.luau
luau
.luau
--[=[ ML-KEM Utilities Module Utility functions for ML-KEM implementation Example usage: local Utils = require(script.Utils) local IsEqual = Utils.CtMemcmp(Buffer1, Buffer2) Utils.CtCondMemcpy(Condition, Dest, Src1, Src2) local PubKeySize = Utils.GetKemPublicKeyLen(4) -- 1568 bytes local SecKeySi...
1,023
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/MlKEM/init.luau
luau
.luau
--[=[ ML-KEM Main Module (Key Encapsulation Mechanism) The complete ML-KEM post quantum key encapsulation. Key generation, encapsulation, and decapsulation operations with CCA security using the Fujisaki Okamoto transform. Example usage: local MlKem = require(script.MlKem) local CSPRNG = require(script.CSP...
2,691
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/Verification/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ EdDSA = require("@self/EdDSA"), MlDSA = require("@self/MlDSA"), MlKEM = require("@self/MlKEM"), }) return Algorithms
48
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/src/init.luau
luau
.luau
--!strict local Cryptography = table.freeze({ Hashing = require("@self/Hashing"), Checksums = require("@self/Checksums"), Utilities = require("@self/Utilities"), Encryption = require("@self/Encryption"), Verification = require("@self/Verification") }) return Cryptography
64
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Adler.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Checksums/Adler") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x1 }, ["a"] = { Description = "Single...
454
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Base64.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string, Algorithm: "Encode" | "Decode" } type TestVectors = {[string]: TestVector} local Algorithm = require("../Utilities/Base64") local TestVectors: TestVectors = { ["VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IG...
680
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Blake2b.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string, OutLen: number?, Key: string? } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/Blake2b") local TestVectors: TestVectors = { ["abc"] = { Description = "Basic ABC Test", Expecte...
6,247
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Blake3.luau
luau
.luau
--!strict local Testing = require("./") local Algorithm = require("../Hashing/Blake3") local New = { Key = "whats the Elvish word for friend", ContextString = "BLAKE3 2019-12-27 16:29:52 test vectors context", Cases = { { InputLen = 0, Hash = "af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262...
17,231
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/CRC32.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Checksums/CRC32") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x00000000 }, ["The quick brown fox jum...
553
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/CSPRNG.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Utilities/CSPRNG") Testing.Describe("CSPRNG Algorithm Tests", function() Testing.Test("Ed25519 Functions", function() local Ed25519Bytes = ...
3,006
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/MD5.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/MD5") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "d41d8cd98f00b204e9800998ecf8427e" }, ["The...
705
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Murmur.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number, Seed: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/Murmur") local TestVectors: TestVectors = { [""] = { Description = "Empty String (Seed 0x00)", Expected = 0x000...
1,095
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA1.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA1") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "da39a3ee5e6b4b0d3255bfef95601890afd80709" ...
765
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA224.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA224") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "d14a028c2a3a2bc9476102bb288234c415a...
903
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA256.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA256") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "e3b0c44298fc1c149afbf4c8996fb92427a...
947
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA3.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA3") local SHA3_224_TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "6b4e03423667dbb73b6e15454f0eb1abd4...
2,764
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA384.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA384") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "38b060a751ac96384cd9327eb1b1e36a21f...
1,204
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/SHA512.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA512") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "cf83e1357eefb8bdf1542850d66d8007d62...
1,425
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Simon.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Mode: "Encrypt" | "Decrypt", Description: string, Expected: string, Key: buffer?, Plaintext: string?, } type TestVectors = {[string]: TestVector} local function FromHex(Hex: string): buffer local Length = #Hex local Buffer = buffer.create(Length / 2)...
985
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/Speck.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Mode: "Encrypt" | "Decrypt", Description: string, Expected: string, Key: buffer?, Plaintext: string?, } type TestVectors = {[string]: TestVector} local function FromHex(Hex: string): buffer local Length = #Hex local Buffer = buffer.create(Length / 2)...
1,320
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/XOR.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Input: string, Key: string, } local function ToHex(Buffer: buffer) : string local Hex = "" for Index = 0, buffer.len(Buffer) - 1 do Hex ..= string.format("%02x", buffer.readu8(Buffer, Index)) end return Hex end local XOR = req...
1,144
daily3014/rbx-cryptography
daily3014-rbx-cryptography-a28191f/tests/XXH32.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number, Seed: number? } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/XXH32") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x02cc5d05 }, ["abc"] = {...
985
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/init.luau
luau
.luau
--!strict --[=[ @class Observers A collection of observer utility functions. ]=] return { observeTag = require(script.observeTag), observeAttribute = require(script.observeAttribute), observeProperty = require(script.observeProperty), observePlayer = require(script.observePlayer), observeCharacter = require(s...
79
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observeAttribute.luau
luau
.luau
--!strict export type AttributeValue = | string | boolean | number | UDim | UDim2 | BrickColor | Color3 | Vector2 | Vector3 | CFrame | NumberSequence | ColorSequence | NumberRange | Rect | Font type Callback = (value: AttributeValue) -> (() -> ())? local function defaultGuard(_value: AttributeValue) ...
664
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observeCharacter.luau
luau
.luau
--!strict local observePlayer = require(script.Parent.observePlayer) type Callback = (player: Player, character: Model) -> (() -> ())? --[=[ @within Observers Creates an observer that captures each character in the game. ```lua observeCharacter(function(player, character) print("Character spawned for " .. pl...
608
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observeLocalCharacter.luau
luau
.luau
--!strict local Players = game:GetService("Players") local RunService = game:GetService("RunService") local IS_CLIENT = RunService:IsClient() type Callback = (character: Model) -> (() -> ())? --[=[ @within Observers @client Creates an observer that captures the local character in the game. This can only be cal...
450
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observePlayer.luau
luau
.luau
--!strict type Callback = (player: Player) -> (() -> ())? local Players = game:GetService("Players") --[=[ @within Observers Creates an observer that captures each player in the game. ```lua observePlayer(function(player) print("Player entered game", player.Name) return function(exitReason) -- Cleanup ...
526
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observeProperty.luau
luau
.luau
--!strict type Callback<T> = (value: T) -> (() -> ())? --[=[ @within Observers Creates an observer around a property of a given instance. ```lua observeProperty(workspace.Model, "Name", function(newName: string) print("New name:", name) return function() -- Cleanup print("Model's name is no longer:",...
367
Sleitnick/RbxObservers
Sleitnick-RbxObservers-0b717ac/lib/observeTag.luau
luau
.luau
--!strict local CollectionService = game:GetService("CollectionService") type InstanceStatus = "__inflight__" | "__dead__" type Callback<T> = (instance: T) -> (() -> ())? --[=[ @within Observers Creates an observer around a CollectionService tag. The given callback will fire for each instance that has the given...
1,336
Ultray-Studios/RBXConnectionManager
Ultray-Studios-RBXConnectionManager-18be690/RBXConnectionManager.luau
luau
.luau
local Players = game:GetService("Players") local RunService = game:GetService("RunService") local RBXConnectionManager = {} RBXConnectionManager.__index = RBXConnectionManager -- Constructor -- function RBXConnectionManager.new(monitoring_checker_interval: number?, osdate_format: string?) local self = setmetatable({}...
1,232
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/build-standalone.luau
luau
.luau
local fs = require("@lune/fs") local roblox = require("@lune/roblox") local process = require("@lune/process") local run = require("@utils/run") run("rojo", { "build", "test.project.json", "--output", "test-place.rbxl" }) local function trim(s: string) return s:match("^%s*(.-)%s*$") end local gameRoot = roblox.dese...
274
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/generate/init.luau
luau
.luau
local fs = require("@lune/fs") local process = require("@lune/process") local run = require("@utils/run") local commandName = process.args[1] local writePath = process.args[2] local result pcall(function() run("rojo", { "build", "test.project.json", "--output", "test-place.rbxl" }) result = run( "run-in-roblox", ...
139
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/generate/support-csv.luau
luau
.luau
local pkgRoot = game.ReplicatedStorage.Packages.Bufferize local dataTypes = require(pkgRoot.DataTypes) -- https://tableconvert.com/csv-to-markdown local SUPPORT_MAP = { ["implemented"] = "✔", ["unimplemented"] = "❌", ["never"] = "⛔", } local lines = { "DataType, Supported, Overridable" } local definitionsByTypeId...
240
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/generate/type-unions.luau
luau
.luau
local pkgRoot = game.ReplicatedStorage.Packages.Bufferize local dataTypes = require(pkgRoot.DataTypes) local definitionsByTypeId = dataTypes.Encoder.definitionsByTypeId local maxTypeId = -1 for _, definition in definitionsByTypeId do maxTypeId = math.max(definition.typeId, maxTypeId) end local supportedTypings = {}...
222
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/jest-test.luau
luau
.luau
local fs = require("@lune/fs") local serde = require("@lune/serde") local roblox = require("@lune/roblox") local run = require("@utils/run") local function enableFFlagEnableLoadModule() local hadFolder = true local pathToStudio = roblox.studioApplicationPath():gsub("\\", "/") local clientSettingsFolderPath = pathTo...
369
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/lune/wally-install.luau
luau
.luau
local fs = require("@lune/fs") local run = require("@utils/run") run("wally", { "install" }) for _, folderName in { "Packages", "DevPackages", "ServerPackages" } do if not fs.isDir(folderName) then fs.writeDir(folderName) end end run("rojo", { "sourcemap", "test.project.json", "-o", "sourcemap.json" }) for _, fo...
154
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/src/BufferStream.luau
luau
.luau
local BufferStreamPkg = require(script.Parent.Parent.BufferStream) local BufferStream = {} export type BufferStream = BufferStreamPkg.BufferStream BufferStream.static = BufferStreamPkg.static BufferStream.dynamic = BufferStreamPkg.dynamic function BufferStream.readTypeId(stream: BufferStream) return stream:readu8(...
97
EgoMoose/rbx-bufferize
EgoMoose-rbx-bufferize-4aadc9e/src/DataTypes/DataTypeDefinition.luau
luau
.luau
local dataTypesRoot = script.Parent local TypeIds = require(dataTypesRoot.TypeIds) local BufferStream = require(dataTypesRoot.Parent.BufferStream) local DataTypeDefinitionStatic = {} local DataTypeDefinitionClass = {} DataTypeDefinitionClass.__index = DataTypeDefinitionClass DataTypeDefinitionClass.ClassName = "DataT...
568