INNER CODE UNIT · Swift

update

Kitura/BlueCryptor · Sources/Cryptor/HMAC.swift:308

	public func update(from buffer: UnsafeRawPointer, byteCount: size_t) -> Self? {
		
		#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
	        CCHmacUpdate(context, buffer, byteCount)
		#elseif os(Linux)
			HMAC_Update(context, buffer.assumingMemoryBound(to: UInt8.self), byteCount)
		#endif
        return self
    }
    
    ///
    /// Finalizes the HMAC calculation
    ///
    /// - Returns: The final calculated HMAC
    ///
	public func final() -> [UInt8] {
		
		var hmac = Array<UInt8>(repeating: 0, count:algorithm.digestLength())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…