Fix random.random
Whoops.
This commit is contained in:
		
							parent
							
								
									8d77e6597c
								
							
						
					
					
						commit
						3da91cf3a2
					
				| 
						 | 
				
			
			@ -40,7 +40,7 @@ end
 | 
			
		|||
local function random(len)
 | 
			
		||||
    expect(1, len, "number")
 | 
			
		||||
    lassert(initialized, "attempt to use an uninitialized random generator", 2)
 | 
			
		||||
    local msg = ("\0"):rep(math.min(len, 0) + 32)
 | 
			
		||||
    local msg = ("\0"):rep(math.max(len, 0) + 32)
 | 
			
		||||
    local nonce = ("\0"):rep(12)
 | 
			
		||||
    local out = chacha20.crypt(state, nonce, msg, 8, 0)
 | 
			
		||||
    state = out:sub(1, 32)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue